/* ==============================================
   M3 ESTRATEGIA - PORTAL MODERNO
   Diseño profesional con glassmorphism
   ============================================== */

/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales M3 */
    --teal-50: #e6f7f9;
    --teal-100: #b3e5eb;
    --teal-200: #80d3dd;
    --teal-300: #4dc1cf;
    --teal-400: #1aafc1;
    --teal-500: #21808D;
    --teal-600: #1a6673;
    --teal-700: #144d56;
    --teal-800: #0d333a;
    --teal-900: #071a1d;
    
    /* Neutrales */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    /* Semánticos */
    --primary: var(--teal-500);
    --primary-hover: var(--teal-600);
    --background: #fafafa;
    --surface: #ffffff;
    --text-primary: #0a0a0a;
    --text-secondary: #525252;
    --text-tertiary: #a3a3a3;
    --border: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);
    
    /* Animaciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tipografía global */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==============================================
   PÁGINA DE LOGIN
   ============================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--teal-100) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(33, 128, 141, 0.25);
}

.logo-emoji {
    font-size: 40px;
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.brand-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.login-content {
    margin-bottom: 32px;
}

.welcome-text {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

.btn-google {
    width: 100%;
    padding: 14px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

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

.btn-google:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.google-icon {
    flex-shrink: 0;
}

.error-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.footer-text {
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ==============================================
   DASHBOARD - HEADER
   ============================================== */

.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
}

.dashboard-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-left {
    display: flex;
    align-items: center;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(33, 128, 141, 0.2);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-tagline {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 8px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.user-info-header {
    display: flex;
    flex-direction: column;
}

.user-name-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-email-header {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-logout {
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

/* ==============================================
   DASHBOARD - MAIN CONTENT
   ============================================== */

.dashboard-main {
    flex: 1;
    padding: 48px 0 80px;
}

.container-modern {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 56px;
}

.hero-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.hero-description {
    font-size: 17px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tools Grid */
.tools-section-modern {
    margin-bottom: 56px;
}

.tools-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.tool-card-modern {
    position: relative;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tool-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--teal-400), var(--teal-600));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.tool-card-modern:hover {
    border-color: var(--teal-300);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.tool-card-modern:hover::before {
    opacity: 1;
}

.tool-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(33, 128, 141, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.tool-card-modern:hover .tool-card-glow {
    opacity: 1;
}

.tool-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.tool-icon-modern {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--teal-100), var(--teal-200));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: transform var(--transition-base);
}

.tool-card-modern:hover .tool-icon-modern {
    transform: scale(1.1) rotate(5deg);
}

.tool-badge-modern {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-popular {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.badge-new {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e3a8a;
}

.badge-soon {
    background: var(--gray-100);
    color: var(--text-tertiary);
}

.tool-card-body {
    flex: 1;
    margin-bottom: 20px;
}

.tool-title-modern {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.tool-desc-modern {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.tool-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.tool-link-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.tool-arrow-icon {
    color: var(--primary);
    transition: transform var(--transition-base);
}

.tool-card-modern:hover .tool-arrow-icon {
    transform: translateX(4px);
}

.tool-card-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Stats Section */
.stats-section-modern {
    margin-bottom: 40px;
}

.stats-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card-modern {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
}

.stat-card-modern:hover {
    box-shadow: var(--shadow-md);
}

.stat-icon-modern {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--teal-100), var(--teal-200));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-content-modern {
    display: flex;
    flex-direction: column;
}

.stat-value-modern {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label-modern {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Footer */
.dashboard-footer-modern {
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    background: white;
}

.footer-text-modern {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ==============================================
   TOAST NOTIFICATIONS
   ============================================== */

#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 768px) {
    .header-content {
        padding: 0 20px;
    }
    
    .user-info-header {
        display: none;
    }
    
    .brand-text {
        display: none;
    }
    
    .container-modern {
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-description {
        font-size: 15px;
    }
    
    .tools-grid-modern {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stats-grid-modern {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    #toast-container {
        left: 20px;
        right: 20px;
        top: 20px;
    }
    
    .toast {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .dashboard-main {
        padding: 32px 0 60px;
    }
    
    .hero-section {
        margin-bottom: 40px;
    }
    
    .tools-section-modern {
        margin-bottom: 40px;
    }
}

/* ==============================================
   CONFIRM MODAL
   ============================================== */

.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-modal-overlay.show {
    opacity: 1;
}

.confirm-modal {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-modal-overlay.show .confirm-modal {
    transform: scale(1);
}

.confirm-modal-content {
    padding: 32px;
    text-align: center;
}

.confirm-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.confirm-modal-message {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-confirm {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-confirm-cancel {
    background: var(--gray-100);
    color: var(--text-primary);
}

.btn-confirm-cancel:hover {
    background: var(--gray-200);
}

.btn-confirm-yes {
    background: var(--primary);
    color: white;
}

.btn-confirm-yes:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

@media (max-width: 480px) {
    .confirm-modal-content {
        padding: 24px;
    }
    
    .confirm-modal-actions {
        flex-direction: column;
    }
    
    .btn-confirm {
        width: 100%;
    }
}
