/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --primary-light: #ff8e8e;
    --primary-dark: #ff5252;
    --secondary-color: #4ecdc4;
    --accent-color: #45b7d1;
    --success-color: #96ceb4;
    --warning-color: #ffeaa7;
    --error-color: #fd79a8;
    
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.12), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--gray-100) 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* Utilitários */
.hidden {
    display: none !important;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tela de Login */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-header h1 {
    color: var(--gray-800);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-600);
    margin-bottom: 30px;
    font-size: 1rem;
}

.google-login-btn {
    background: var(--white);
    border: 2px solid var(--gray-300);
    padding: 14px 30px;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 30px;
}

.google-login-btn:hover {
    background: var(--gray-50);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.google-login-btn i {
    color: #4285f4;
    font-size: 1.2rem;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.feature i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

/* Aplicativo Principal */
.app-screen {
    min-height: 100vh;
    background: var(--bg-color);
}

/* Header */
.app-header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    color: var(--gray-800);
    font-size: 1.5rem;
    font-weight: 600;
}

.header-content h1 i {
    color: var(--primary-color);
    margin-right: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary-light);
}

.user-name {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.logout-btn:hover {
    color: var(--error-color);
    background: var(--gray-100);
}

/* Área de Criação de Anotação */
.note-creation-area {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}

.note-input-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.note-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.note-input {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    background: transparent;
    color: var(--gray-800);
}

.note-input::placeholder {
    color: var(--gray-500);
}

.note-input:focus {
    outline: none;
}

.note-input-footer {
    padding: 16px 20px;
    background: var(--gray-50);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--gray-200);
}

.char-counter {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.save-note-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.save-note-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.save-note-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Área de Geração com IA */
.ai-generation-area {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 20px;
    color: white;
}

.ai-section-header h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.ai-section-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.ai-controls {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.category-selector {
    flex: 1;
    min-width: 200px;
}

.category-selector label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.category-select {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.category-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.category-select option {
    background: var(--gray-800);
    color: white;
}

.ai-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.ai-btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ai-btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-btn-secondary {
    background: linear-gradient(135deg, var(--success-color), var(--secondary-color));
    color: white;
    border: none;
}

.ai-btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--success-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.ai-status {
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-status-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.ai-loading i {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Seção de Anotações */
.notes-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.notes-header h2 {
    color: var(--gray-800);
    font-size: 1.3rem;
    font-weight: 600;
}

.notes-header h2 i {
    color: var(--secondary-color);
    margin-right: 8px;
}

.notes-count {
    background: var(--primary-light);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Container de Anotações */
.notes-container {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.note-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.note-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.note-card.ai-generated {
    border-left-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02), rgba(118, 75, 162, 0.02));
}

.note-card.ai-generated::before {
    content: "🤖";
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 1;
}

.note-content {
    padding: 20px;
}

.note-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.85rem;
    color: var(--gray-500);
}

.note-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-actions {
    display: flex;
    gap: 8px;
}

.note-action-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.note-action-btn:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.note-action-btn.delete:hover {
    color: var(--error-color);
}

/* Estado Vazio */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--gray-600);
}

.empty-state p {
    font-size: 1rem;
}

/* Mensagens Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
}

.toast {
    background: var(--white);
    color: var(--gray-800);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.info {
    border-left: 4px solid var(--accent-color);
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    to {
        transform: translateX(100%);
    }
}

/* iPhone Notes Preview */
.iphone-notes-section {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
}

.iphone-notes-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.iphone-notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.iphone-notes-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.notes-actions {
    display: flex;
    gap: 12px;
}

.download-btn, .close-preview-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.download-btn:hover, .close-preview-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.close-preview-btn {
    padding: 8px 12px;
}

/* iPhone Screen */
.iphone-screen {
    width: 375px;
    height: 667px;
    margin: 20px auto;
    background: #000000;
    border-radius: 40px;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.iphone-screen::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    z-index: 10;
}

/* Status Bar */
.iphone-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 8px 20px;
    background: #F2F1F6;
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.status-left .time {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.signal-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
}

.signal-bars .bar {
    width: 3px;
    background: #000;
    border-radius: 1px;
}

.signal-bars .bar:nth-child(1) { height: 4px; }
.signal-bars .bar:nth-child(2) { height: 6px; }
.signal-bars .bar:nth-child(3) { height: 8px; }
.signal-bars .bar:nth-child(4) { height: 10px; }

.wifi-icon {
    font-size: 12px;
    margin: 0 2px;
}

.battery {
    width: 24px;
    height: 12px;
    border: 1px solid #000;
    border-radius: 2px;
    position: relative;
    margin-left: 4px;
}

.battery::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 3px;
    width: 2px;
    height: 6px;
    background: #000;
    border-radius: 0 1px 1px 0;
}

.battery-level {
    width: 60%;
    height: 100%;
    background: #00C853;
    border-radius: 1px;
}

/* Notes App Header */
.notes-app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #F2F1F6;
    border-bottom: 1px solid #E0E0E0;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #007AFF;
    font-size: 17px;
}

.back-button i {
    font-size: 14px;
}

.notes-title {
    font-size: 17px;
    font-weight: 600;
    color: #000;
}

.more-options {
    color: #007AFF;
    font-size: 17px;
}

/* Notes Content */
.notes-content {
    background: #FEFFFE;
    height: calc(100% - 120px);
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.note-timestamp {
    font-size: 13px;
    color: #8E8E93;
    margin-bottom: 8px;
    text-align: center;
}

.motivational-text {
    font-size: 17px;
    line-height: 1.5;
    color: #000000;
    min-height: 200px;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    word-wrap: break-word;
    text-align: left;
}

/* Animações */
@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.iphone-notes-section.show {
    animation: slideInFromBottom 0.5s ease forwards;
}

/* Responsivo */
@media (max-width: 768px) {
    .header-content {
        padding: 12px 16px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .note-creation-area {
        padding: 20px 16px;
    }
    
    .notes-section {
        padding: 0 16px 40px;
    }
    
    .notes-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .login-container {
        padding: 30px 24px;
        margin: 16px;
    }
    
    .login-header h1 {
        font-size: 1.7rem;
    }
    
    .note-input-footer {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .save-note-btn {
        width: 100%;
        justify-content: center;
    }
    
    .toast {
        margin: 0 16px 10px 16px;
        min-width: auto;
        width: calc(100% - 32px);
    }
    
    /* Responsivo para seção IA */
    .ai-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .category-selector {
        min-width: auto;
    }
    
    .ai-buttons {
        justify-content: center;
    }
    
    .ai-btn {
        flex: 1;
        justify-content: center;
        min-width: 140px;
    }
    
    /* Responsivo iPhone Notes */
    .iphone-screen {
        width: 320px;
        height: 568px;
        margin: 10px auto;
    }
    
    .iphone-notes-section {
        padding: 0 10px;
    }
    
    .iphone-notes-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .notes-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .user-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .user-name {
        font-size: 0.8rem;
    }
    
    .note-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}
