/* ESIIL Portal - Main Stylesheet */

/* CSS Variables / Design Tokens */
:root {
    /* Colors */
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7c8ef8;
    --secondary-color: #764ba2;
    --secondary-dark: #663d8e;
    --secondary-light: #8a5cb6;
    
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --info-color: #4299e1;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;
    --spacing-unit: 8px;
    
    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;

    /* Theme Variables (compatibility with base.html theme system) */
    --border-primary: var(--gray-200);
    --bg-tertiary: var(--gray-100);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary, var(--gray-900));
    background-color: var(--bg-secondary, var(--gray-50));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 600;
    line-height: 1.25;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Layout Structure */
.portal-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    background-color: var(--gray-50);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: calc(var(--spacing-unit) * 1); }
.mb-2 { margin-bottom: calc(var(--spacing-unit) * 2); }
.mb-3 { margin-bottom: calc(var(--spacing-unit) * 3); }
.mb-4 { margin-bottom: calc(var(--spacing-unit) * 4); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: calc(var(--spacing-unit) * 1); }
.mt-2 { margin-top: calc(var(--spacing-unit) * 2); }
.mt-3 { margin-top: calc(var(--spacing-unit) * 3); }
.mt-4 { margin-top: calc(var(--spacing-unit) * 4); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

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

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

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

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* Cards */
.card {
    background-color: var(--card-bg, white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary, inherit);
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    padding: 0;
}

.card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
    text-transform: uppercase;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fed7aa;
    color: #92400e;
}

/* Event type badges */
.badge-conference {
    background-color: #e0e7ff;
    color: #4338ca;
}

.badge-summit {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-seminar {
    background-color: #ede9fe;
    color: #6b21a8;
}

.badge-workshop {
    background-color: #fce7f3;
    color: #be185d;
}

.badge-webinar {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-training {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-hackathon {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-symposium {
    background-color: #fed7aa;
    color: #9a3412;
}

.badge-meeting {
    background-color: #e0f2fe;
    color: #075985;
}

.badge-info_session {
    background-color: #f3e8ff;
    color: #6b21a8;
}

.badge-other {
    background-color: #f3f4f6;
    color: #374151;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--gray-900);
    background-color: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Grid Systems */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Sections */
.section {
    padding: 3rem 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
}

.section-footer {
    text-align: center;
    margin-top: 3rem;
}

/* Notifications */
.notifications-container {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1rem;
    z-index: 9999;
    pointer-events: none;
}

.notification {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    pointer-events: all;
    transform: translateX(400px);
    transition: transform var(--transition);
}

.notification.show {
    transform: translateX(0);
}

.notification i {
    font-size: 1.25rem;
}

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

.notification-success i {
    color: var(--success-color);
}

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

.notification-error i {
    color: var(--danger-color);
}

.notification-warning {
    border-left: 4px solid var(--warning-color);
}

.notification-warning i {
    color: var(--warning-color);
}

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

.notification-info i {
    color: var(--info-color);
}

.notification-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0;
    line-height: 1;
}

.notification-close:hover {
    color: var(--gray-600);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tooltips */
.tooltip {
    position: absolute;
    background: var(--gray-800);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 2rem 1rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .notifications-container {
        left: 1rem;
        right: 1rem;
    }
    
    .notification {
        min-width: unset;
    }
}
/* Footer */
.portal-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    margin-top: 4rem;
    padding: 3rem 0 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.footer-text {
    color: var(--gray-600);
    line-height: 1.6;
}

.partner-logos {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.partner-logo {
    height: 50px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.partner-logo:hover {
    opacity: 1;
}

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

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-600);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 0.875rem;
}

.footer-bottom a {
    color: var(--gray-600);
    margin: 0 0.5rem;
}

.footer-bottom a:hover {
    color: var(--primary-color);
}

/* User Dropdown Styles */
.user-profile {
    position: relative;
}

.user-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--nav-text);
}

.user-icon:hover {
    background-color: var(--bg-hover);
}

.user-avatar-emoji {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 2px solid var(--border-primary);
}

.user-name {
    font-weight: 500;
    color: var(--nav-text);
}

.user-icon i {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-icon.active i {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 240px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

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

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.dropdown-header strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.dropdown-header small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-primary);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
}

/* Mobile Responsive for User Profile */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }

    .user-dropdown {
        min-width: 220px;
        right: -1rem;
    }
}
