/**
 * Grammar Guru Modular Components CSS
 * Additional styles for header, footer, and modular component system
 * Works with existing global.css styles
 * 
 * @author Grammar Guru Team
 * @version 1.0.0
 */

/* ========================================
   HEADER COMPONENT ENHANCEMENTS
======================================== */

/* Dashboard Navigation Specific Styles */
.dashboard-nav {
    align-items: center;
    gap: 1.5rem;
}

.nav-notifications {
    position: relative;
    display: flex;
    align-items: center;
}

.notification-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    color: #4a5568;
    cursor: pointer;
    position: relative;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.notification-btn:hover {
    background: #f7fafc;
    color: #667eea;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #f56565;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-text {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #4a5568;
}

.user-dropdown-toggle:hover {
    background: #f7fafc;
    color: #667eea;
}

.user-dropdown-toggle .icon-chevron-down {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    line-height: 1;
    transform: translateY(0);
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: #f7fafc;
    color: #667eea;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid #e2e8f0;
}

/* ========================================
   FOOTER COMPONENTS ENHANCEMENTS
======================================== */

/* Newsletter Section for Footer */
.footer-newsletter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.newsletter-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
}

.newsletter-description {
    font-size: 1.125rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.newsletter-form {
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.newsletter-input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: #1a202c;
}

.newsletter-input::placeholder {
    color: #a0aec0;
}

.newsletter-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    background: white;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.newsletter-btn:hover {
    background: #f7fafc;
    transform: translateY(-2px);
}

/* ========================================
   MESSAGE SYSTEM STYLES
======================================== */

.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.message {
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    animation: messageSlideIn 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
}

.message-info {
    background: rgba(59, 130, 246, 0.95);
    color: white;
    border-left: 4px solid #3b82f6;
}

.message-success {
    background: rgba(16, 185, 129, 0.95);
    color: white;
    border-left: 4px solid #10b981;
}

.message-error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border-left: 4px solid #ef4444;
}

.message-warning {
    background: rgba(245, 158, 11, 0.95);
    color: white;
    border-left: 4px solid #f59e0b;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   MOBILE RESPONSIVE OVERRIDES
======================================== */

@media (max-width: 768px) {
    .dashboard-nav {
        align-items: stretch;
        gap: 1rem;
    }

    .nav-user {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e2e8f0;
    }

    .user-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        margin-top: 1rem;
    }

    .footer-newsletter {
        padding: 30px 20px;
        margin-bottom: 30px;
    }

    .newsletter-title {
        font-size: 1.75rem;
    }

    .newsletter-input-group {
        flex-direction: column;
        gap: 12px;
    }

    .newsletter-input,
    .newsletter-btn {
        width: 100%;
    }

    .message-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .newsletter-title {
        font-size: 1.5rem;
    }
}

/* ========================================
   COMPONENT LOADING STATES
======================================== */

.component-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #a0aec0;
}

.component-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: componentSpin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes componentSpin {
    to { transform: rotate(360deg); }
}

/* ========================================
   UTILITY CLASSES FOR COMPONENTS
======================================== */

.component-hidden {
    display: none !important;
}

.component-visible {
    display: block !important;
}

.component-fade-in {
    animation: componentFadeIn 0.3s ease;
}

@keyframes componentFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   FOOTER COMPONENT STYLES
======================================== */

/* Main Footer Styles */
.footer {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: white;
    padding: 60px 0 30px;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footergrain" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23footergrain)"/></svg>');
    opacity: 0.3;
}

.footer-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section {
    padding: 0;
}

.footer-brand {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.footer-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.footer-logo.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.footer-brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.footer-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #a0aec0;
    margin: 0;
    max-width: 300px;
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #a0aec0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.footer-links a:hover {
    color: #667eea;
    transform: translateX(4px);
}

.footer-links a::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}

.footer-links a:hover::before {
    width: 4px;
}

/* Footer Bottom */
.footer-bottom {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    margin: 0;
    color: #a0aec0;
    font-size: 0.875rem;
}

/* Social Links */
.footer-social {
    display: flex;
    gap: 16px;
    align-items: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: #a0aec0;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.social-link:hover::before {
    left: 100%;
}

.social-link:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.3);
}

/* Social Icons (Unicode characters as fallback) */
.social-link[href*="twitter"]::after,
.social-link[title*="Twitter"]::after { 
    content: "𝕏"; 
    font-size: 16px;
    font-weight: bold;
}

.social-link[href*="linkedin"]::after,
.social-link[title*="LinkedIn"]::after { 
    content: "in"; 
    font-size: 12px;
    font-weight: bold;
    text-transform: lowercase;
}

.social-link[href*="github"]::after,
.social-link[title*="GitHub"]::after { 
    content: "⚡"; 
    font-size: 14px;
}

/* Responsive Design for Footer */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 30px;
    }
    
    .footer-section:last-child {
        grid-column: 1 / -1;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-brand {
        justify-content: center;
    }
    
    .footer-description {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .footer-social {
        justify-content: center;
    }
    
    .social-link {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
}
