/* Shared CSS for NASPA AC Membership App */

/* Critical CSS for faster rendering with performance optimizations */

/* Use CSS containment for better performance */
.container {
    contain: layout style paint;
}

/* Optimize font rendering */
body { 
    margin: 0;
    text-align: center; 
    background-color: #f5f5f5;
    font-display: swap; /* Improve font loading performance */
    text-rendering: optimizeSpeed; /* Prioritize speed over quality */
}

.container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 20px auto;
    /* GPU acceleration for smoother animations */
    transform: translateZ(0);
    will-change: transform;
    /* Prevent horizontal scrolling on mobile */
    box-sizing: border-box;
    width: 100%;
}

h1 {
    color: var(--blue);
    margin-bottom: 20px;
    /* Optimize text rendering */
    text-rendering: optimizeSpeed;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding: 0 10px; /* Add padding for mobile */
}

.header h1 {
    color: var(--blue);
    margin-bottom: 10px;
    font-size: 2rem; /* Make responsive */
    line-height: 1.2;
}

.header h2 {
    color: var(--blue);
    margin-bottom: 20px;
    font-size: 1.5rem; /* Make responsive */
    line-height: 1.3;
}

/* Button styles */
.btn {
    display: inline-block;
    padding: 12px 30px;
    margin: 10px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
    /* GPU acceleration for smoother hover effects */
    transform: translateZ(0);
    will-change: background-color;
}

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

.btn-primary:hover {
    background-color: var(--hovergreen);
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-secondary:hover {
    background-color: #444;
}

.login-button { 
    background-color: var(--green); 
    color: white; 
    padding: 15px 30px; 
    text-decoration: none; 
    border-radius: 5px; 
    font-size: 16px;
    display: inline-block;
    transition: background-color 0.2s ease-out; /* Optimize transition */
    /* GPU acceleration for smoother hover effects */
    transform: translateZ(0);
    will-change: background-color;
}

.login-button:hover {
    background-color: var(--hovergreen);
}

/* Logout button */
.logout-btn {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    z-index: 10;
    white-space: nowrap;
}

.logout-btn:hover {
    background-color: #c82333;
}

/* Message containers */
.logout-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    text-align: center;
    /* GPU acceleration for show/hide animations */
    transform: translateZ(0);
    will-change: opacity, display;
}

.logout-message.quick {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.user-info {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid var(--blue);
}

.user-info strong {
    color: var(--blue);
}

.loading {
    display: none;
    color: #666;
    margin-top: 20px;
    text-align: center;
    font-size: 18px;
    /* GPU acceleration */
    transform: translateZ(0);
}

.error {
    background-color: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.success {
    background-color: #e8f5e8;
    border: 1px solid #4caf50;
    color: #2e7d32;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.member-info {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.action-buttons {
    text-align: center;
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.debug-info {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 10px;
    border-radius: 4px;
    margin: 20px 0;
    font-family: monospace;
    font-size: 12px;
    text-align: left;
    display: none;
    /* Optimize for development performance */
    contain: layout style;
}

.logout-confirmation {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

.logout-confirmation .btn {
    margin: 5px;
}

/* Environment badge */
.env-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
    text-transform: uppercase;
    background-color: #28a745;
    color: white;
    /* GPU acceleration */
    transform: translateZ(0);
}

.env-production {
    display: none; /* Hide in production */
}

/* Optimize image loading */
#naspaACLogo {
    /* Optimize image rendering */
    image-rendering: optimizeQuality;
    max-width: 150px;
    height: auto;
    /* GPU acceleration */
    transform: translateZ(0);
}

/* Optimize navigation performance */
#NASPA-Nav {
    /* Use containment for better performance */
    contain: layout style;
    /* Prevent horizontal scrolling */
    overflow-x: auto;
    width: 100%;
}

/* Responsive Design - Mobile and Tablet */
@media (max-width: 768px) {
    #NASPA-Nav {
        font-size: 0.9rem !important;
    }
    
    #NASPA-Nav .row.expanded.tertiary {
        padding: 5px 10px;
    }
    
    #NASPA-Nav .search-plus-social {
        display: none; /* Hide social links on mobile to save space */
    }
    
    .container {
        padding: 20px 15px;
        margin: 10px auto;
        max-width: 95%;
    }
    
    .header {
        padding: 0 5px;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
        margin-bottom: 8px;
        padding-right: 80px; /* Make space for logout button */
    }
    
    .header h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .logout-btn {
        top: 5px;
        right: 5px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .btn {
        padding: 10px 20px;
        margin: 8px 5px;
        font-size: 14px;
        display: block;
        width: calc(100% - 10px);
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .login-button {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .debug-info {
        font-size: 10px;
        padding: 8px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
        padding-right: 70px;
    }
    
    .header h2 {
        font-size: 1.1rem;
    }
    
    .logout-btn {
        top: 3px;
        right: 3px;
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .container {
        padding: 15px 10px;
        margin: 5px auto;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .login-button {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .header h1 {
        font-size: 1.4rem;
    }
    
    .header h2 {
        font-size: 1.1rem;
    }
    
    .container {
        padding: 15px;
    }
}
