/* CIRED Malaysia - Frontend Styles */

/* ===== DESIGN TOKENS ===== */
:root {
    /* Primary Color Palette */
    --cired-primary: #0d6efd;
    --cired-primary-dark: #0056b3;
    --cired-primary-light: #6ea8fe;
    --cired-primary-lighter: #cfe2ff;
    
    /* Secondary Colors */
    --cired-secondary: #6c757d;
    --cired-success: #198754;
    --cired-warning: #ffc107;
    --cired-danger: #dc3545;
    --cired-info: #0dcaf0;
    --cired-light: #f8f9fa;
    --cired-dark: #212529;
    
    /* Semantic Colors */
    --cired-premium: #6f42c1;
    --cired-premium-light: #e7d9ff;
    --cired-membership: #20c997;
    --cired-event: #fd7e14;
    --cired-forum: #198754;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--cired-primary) 0%, var(--cired-primary-dark) 100%);
    --gradient-premium: linear-gradient(135deg, #6f42c1 0%, #563d7c 100%);
    --gradient-membership: linear-gradient(135deg, #20c997 0%, #198754 100%);
    --gradient-hero: linear-gradient(135deg, #0d6efd 0%, #6f42c1 50%, #20c997 100%);
    
    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --shadow-premium: 0 0.5rem 1rem rgba(111, 66, 193, 0.25);
    
    /* Typography */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-display: 'Poppins', var(--font-family-sans);
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Border Radius */
    --border-radius-sm: 0.375rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-radius-2xl: 1.5rem;
    --border-radius-pill: 50rem;
    
    /* Transitions */
    --transition-fast: all 0.15s ease-in-out;
    --transition: all 0.3s ease-in-out;
    --transition-slow: all 0.5s ease-in-out;
    --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== BASE STYLES ===== */
body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--cired-dark);
    background-color: var(--cired-light);
}

/* ===== HERO SECTIONS ===== */
.hero-section {
    background: var(--gradient-hero);
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::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 20"><path d="M21.184 20c.357 0 .672-.093.953-.278l1.85-1.85c.18-.18.301-.43.361-.725.045-.27.045-.57 0-.84-.061-.294-.181-.544-.361-.725l-1.85-1.85c-.281-.185-.596-.278-.953-.278-.357 0-.672.093-.953.278L18.381 15.5c-.18.18-.301.43-.361.725-.045.27-.045.57 0 .84.061.294.181.544.361.725l1.85 1.85c.281.185.596.278.953.278zM81.184 20c.357 0 .672-.093.953-.278l1.85-1.85c.18-.18.301-.43.361-.725.045-.27.045-.57 0-.84-.061-.294-.181-.544-.361-.725l-1.85-1.85c-.281-.185-.596-.278-.953-.278-.357 0-.672.093-.953.278l-1.85 1.85c-.18.18-.301.43-.361.725-.045.27-.045.57 0 .84.061.294.181.544.361.725l1.85 1.85c.281.185.596.278.953.278z" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* ===== CARDS ===== */
.cired-card {
    background: white;
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.cired-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: var(--shadow-lg);
}

.cired-card-premium {
    border: 2px solid var(--cired-premium);
    box-shadow: var(--shadow-premium);
}

.cired-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-premium);
}

/* ===== BUTTONS ===== */
.btn-cired {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: var(--font-size-sm);
    transition: var(--transition-bounce);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-cired::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.6s ease;
}

.btn-cired:hover::before {
    left: 100%;
}

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

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

.btn-cired-premium {
    background: var(--gradient-premium);
    color: white;
    border-color: var(--cired-premium);
}

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

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

/* ===== BADGES ===== */
.badge-cired {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-pill);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-premium {
    background: var(--gradient-premium);
    color: white;
}

.badge-free {
    background: var(--gradient-membership);
    color: white;
}

.badge-event {
    background: var(--cired-event);
    color: white;
}

/* ===== FORMS ===== */
.form-cired {
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-control-cired {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: var(--font-size-base);
}

.form-control-cired:focus {
    border-color: var(--cired-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

/* ===== NAVIGATION ===== */
.navbar-cired {
    background: var(--gradient-primary);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar-brand-cired {
    font-family: var(--font-family-display);
    font-weight: 700;
    font-size: var(--font-size-2xl);
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.navbar-brand-cired:hover {
    color: var(--cired-warning);
    transform: scale(1.05);
}

.nav-link-cired {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-pill);
    transition: var(--transition);
    margin: 0 0.25rem;
}

.nav-link-cired:hover,
.nav-link-cired.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

/* ===== DROPDOWNS ===== */
.dropdown-menu-cired {
    background: white;
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    animation: dropdownFadeIn 0.3s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-item-cired {
    padding: 0.75rem 1.5rem;
    color: var(--cired-dark);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.dropdown-item-cired:hover {
    background: var(--cired-primary-lighter);
    border-left-color: var(--cired-primary);
    color: var(--cired-primary-dark);
    transform: translateX(0.25rem);
}

/* ===== TABLES ===== */
.table-cired {
    background: white;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-cired th {
    background: var(--cired-light);
    border: none;
    font-weight: 600;
    color: var(--cired-dark);
    padding: 1rem;
    text-transform: uppercase;
    font-size: var(--font-size-sm);
    letter-spacing: 0.5px;
}

.table-cired td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
}

.table-cired tbody tr {
    transition: var(--transition);
}

.table-cired tbody tr:hover {
    background: var(--cired-primary-lighter);
    transform: scale(1.01);
}

/* ===== ALERTS ===== */
.alert-cired {
    border: none;
    border-radius: var(--border-radius-xl);
    padding: 1rem 1.5rem;
    border-left: 4px solid;
    box-shadow: var(--shadow);
    animation: alertSlideIn 0.5s ease-out;
}

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

.alert-cired-success {
    background: linear-gradient(135deg, #d1e7dd 0%, #a3d9a3 100%);
    border-left-color: var(--cired-success);
    color: #0a3622;
}

.alert-cired-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5b2b2 100%);
    border-left-color: var(--cired-danger);
    color: #721c24;
}

.alert-cired-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-left-color: var(--cired-warning);
    color: #856404;
}

.alert-cired-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #a3d5db 100%);
    border-left-color: var(--cired-info);
    color: #055160;
}

/* ===== BREADCRUMBS ===== */
.breadcrumb-cired {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-cired .breadcrumb-item {
    font-size: var(--font-size-sm);
}

.breadcrumb-cired .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-weight: bold;
    color: var(--cired-secondary);
}

.breadcrumb-cired .breadcrumb-item a {
    color: var(--cired-primary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-cired .breadcrumb-item a:hover {
    color: var(--cired-primary-dark);
}

/* ===== PAGINATION ===== */
.pagination-cired .page-link {
    border: 2px solid #dee2e6;
    border-radius: var(--border-radius-pill);
    color: var(--cired-primary);
    padding: 0.5rem 1rem;
    margin: 0 0.125rem;
    transition: var(--transition);
}

.pagination-cired .page-link:hover {
    background: var(--cired-primary);
    border-color: var(--cired-primary);
    color: white;
    transform: translateY(-2px);
}

.pagination-cired .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--cired-primary);
    box-shadow: var(--shadow);
}

/* ===== FOOTER ===== */
.footer-cired {
    background: var(--cired-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-cired h5 {
    color: white;
    font-family: var(--font-family-display);
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.footer-cired h5::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 3rem;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius);
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    padding: 0.25rem 0;
    display: inline-block;
}

.footer-link:hover {
    color: white;
    transform: translateX(0.25rem);
}

/* ===== UTILITIES ===== */
.user-name-truncate {
    max-width: 120px;
}

.toast-container-cired {
    z-index: 9999;
    top: 85px;
}

.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-gradient-premium {
    background: var(--gradient-premium);
}

.shadow-cired {
    box-shadow: var(--shadow);
}

.shadow-cired-lg {
    box-shadow: var(--shadow-lg);
}

.rounded-cired {
    border-radius: var(--border-radius-xl);
}

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-0.25rem);
    box-shadow: var(--shadow-lg);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .btn-cired {
        padding: 0.625rem 1.25rem;
        font-size: var(--font-size-xs);
    }
    
    .navbar-brand-cired {
        font-size: var(--font-size-xl);
    }
    
    .form-cired {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
    }
    
    .btn-cired {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table-cired {
        font-size: var(--font-size-sm);
    }
    
    .cired-card {
        margin-bottom: 1rem;
    }
}

/* ===== EVENT SPECIFIC STYLES ===== */
.event-hero {
    position: relative;
    min-height: 500px;
    overflow: hidden;
}

.hero-image-container {
    position: relative;
    width: 100%;
    height: 500px;
}

.hero-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.hero-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.8) 100%);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    color: white;
    padding: var(--spacing-xl);
}

.text-shadow {
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.meta-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.breadcrumb-dark .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-weight: bold;
    color: rgba(255,255,255,0.75);
}

.prose-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #495057;
}

.prose-content p {
    margin-bottom: 1.5rem;
}

.prose-content h1,
.prose-content h2,
.prose-content h3,
.prose-content h4,
.prose-content h5,
.prose-content h6 {
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #212529;
}

.prose-content ul,
.prose-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.prose-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
}

.registration-card {
    border: 2px solid #e9ecef;
    position: sticky;
    top: 2rem;
}

.price-display .display-5,
.price-display .display-6 {
    line-height: 1.2;
}

.external-registration {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--border-radius-xl);
    padding: var(--spacing-lg);
}

.material-item {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.material-item:hover {
    border-color: var(--cired-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.material-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 50%;
}

.detail-item {
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition-bounce);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin: 0 0.25rem;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
    transform: scale(0);
}

.social-links a:hover::before {
    opacity: 1;
    transform: scale(1);
}

.social-links a:hover {
    transform: translateY(-8px) scale(1.15);
    box-shadow: var(--shadow-lg);
}

.social-links a i {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover i {
    color: white;
    transform: scale(1.1);
}

/* Event Status Badges */
.event-status-upcoming {
    background: var(--gradient-primary);
    color: white;
}

.event-status-ongoing {
    background: var(--gradient-membership);
    color: white;
}

.event-status-ended {
    background: var(--cired-secondary);
    color: white;
}

/* Event Registration Progress */
.event-progress {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.event-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Copy link button feedback */
.copy-success {
    background: var(--cired-success) !important;
    border-color: var(--cired-success) !important;
    color: white !important;
}

/* Event Mobile Responsiveness */
@media (max-width: 768px) {
    .event-hero {
        min-height: 400px;
    }
    
    .hero-image-container,
    .hero-image {
        height: 400px;
    }
    
    .hero-content {
        padding: var(--spacing-lg);
    }
    
    .meta-icon {
        width: 35px;
        height: 35px;
    }
    
    .registration-card {
        position: relative !important;
        top: 0 !important;
        margin-bottom: 2rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .social-links a {
        width: 45px;
        height: 45px;
    }
    
    .detail-item {
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }
}