/* Base Styles - Famirello Application */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    white-space: nowrap;
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.main-nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.main-nav a:hover {
    opacity: 0.8;
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 2001;
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 500;
}

.user-menu-arrow {
    transition: transform 0.3s ease;
}

.user-menu-btn.active .user-menu-arrow {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 1rem 1.25rem;
}

.user-dropdown-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.user-dropdown-email {
    font-size: 0.85rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-divider {
    height: 1px;
    background: #e0e0e0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.user-dropdown-item:hover {
    background: #f8f9fa;
}

.user-dropdown-item.logout {
    color: #dc3545;
}

.user-dropdown-item.logout:hover {
    background: #fff5f5;
}

.dropdown-icon {
    font-size: 1.1rem;
}

/* Container Styles */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Card Styles */
.card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 100%;
}

/* Typography */
h1, h2 {
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Button Styles */
.btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #6c757d;
    margin-top: 0.5rem;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.link {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    color: #999;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Password Strength Indicator */
.password-strength {
    height: 5px;
    margin-top: 0.5rem;
    border-radius: 3px;
    transition: all 0.3s;
}

.strength-weak { 
    background: #dc3545; 
    width: 33%; 
}

.strength-medium { 
    background: #ffc107; 
    width: 66%; 
}

.strength-strong { 
    background: #28a745; 
    width: 100%; 
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Dashboard container override */
.container.dashboard-wrapper {
    display: block;
    align-items: unset;
    justify-content: unset;
    padding: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        padding: 1.5rem;
    }
    
    header {
        padding: 1rem;
        position: relative;
        z-index: 1998;
    }
    
    .header-content {
        gap: 0.5rem;
    }
    
    /* Show hamburger button on mobile */
    .hamburger-btn {
        display: flex;
    }
    
    /* Mobile navigation */
    .main-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: rgb(255, 255, 255);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        gap: 0;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
        transition: left 0.3s ease;
        z-index: 2000;
    }
    
    .main-nav.active {
        left: 0;
    }
    
    .main-nav a {
        color: #333;
        padding: 1rem 0;
        width: 100%;
        border-bottom: 1px solid #e0e0e0;
        font-size: 1.1rem;
    }
    
    .main-nav a:hover {
        opacity: 1;
        color: #667eea;
    }
    
    /* User menu adjustments for mobile */
    .user-menu {
        margin-left: auto;
    }
    
    .user-menu-btn {
        padding: 0.4rem 0.75rem;
    }
    
    .user-name {
        display: none;
    }
    
    .user-menu-arrow {
        display: none;
    }
    
    .user-dropdown {
        right: 0;
        min-width: 200px;
    }
    
    /* Mobile overlay for navigation */
    .nav-overlay {
        display: none;
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
    }
    
    .nav-overlay.active {
        display: block;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }
    
    .user-dropdown {
        min-width: 220px;
        right: -1rem;
    }
}

/* ==========================================
   News Modal Styles
   ========================================== */

.news-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.news-modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.news-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease;
    display: flex;
    flex-direction: column;
}

.news-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.news-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-modal-icon {
    font-size: 1.75rem;
}

.news-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.news-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.news-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.news-modal-counter {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.news-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.news-modal-message {
    color: #4b5563;
    line-height: 1.6;
    font-size: 1rem;
}

.news-modal-message p {
    margin-bottom: 1rem;
}

.news-modal-message p:last-child {
    margin-bottom: 0;
}

.news-modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: #f9fafb;
}

.news-modal-footer .news-modal-btn:only-child {
    margin-left: auto;
}

.news-modal-date {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.news-modal-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.news-modal-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.news-modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.news-modal-btn-secondary {
    background: #e5e7eb;
    color: #4b5563;
}

.news-modal-btn-secondary:hover {
    background: #d1d5db;
}

/* News Type Indicators */
.news-modal.news-type-info .news-modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.news-modal.news-type-warning .news-modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.news-modal.news-type-success .news-modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.news-modal.news-type-announcement .news-modal-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .news-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .news-modal-header {
        padding: 1.25rem 1.5rem;
    }
    
    .news-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .news-modal-body {
        padding: 1.5rem;
    }
    
    .news-modal-footer {
        padding: 0.875rem 1.5rem;
        flex-direction: column;
    }
    
    .news-modal-btn {
        width: 100%;
    }
}
