/**
 * Custom Dark Theme Styles for SRIC
 * Extracted from HTML templates and adapted for Laravel Blade
 */

:root {
    /* Background colors */
    --bg-body: #050b14;
    --bg-sidebar: #0f141e;
    --bg-header: rgba(15, 20, 30, 0.7);

    /* Glass Cards */
    --bg-card: rgba(30, 41, 59, 0.4);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(40, 55, 80, 0.6);

    /* Typography */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    /* Accents */
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-glow: rgba(59, 130, 246, 0.5);

    /* Metallic Gradients */
    --metal-sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.05) 100%);
    --metal-border-top: linear-gradient(90deg, rgba(59, 130, 246, 0) 0%, rgba(148, 163, 184, 0.3) 20%, rgba(255, 255, 255, 0.5) 50%, rgba(148, 163, 184, 0.3) 80%, rgba(59, 130, 246, 0) 100%);

    /* Fonts */
    --font-display: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Mouse Tracker */
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* Global Styles */
html.dark {
    height: 100%;
}

html.dark body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(29, 78, 216, 0.15), transparent 40%),
        radial-gradient(circle at 10% 10%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
        #050b14;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-in {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Layout Wrapper */
.layout-wrapper.dark-theme {
    background-color: var(--bg-body);
}

/* Sidebar Styles */
.layout-menu.menu.bg-menu-theme {
    background-color: var(--bg-sidebar) !important;
    border-right: 1px solid var(--bg-card-border);
}

.app-brand.demo {
    margin-bottom: 0rem;
    padding-left: 0.5rem;
}

.app-brand-text.demo {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 40%, #93c5fd 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.2));
}

.app-brand-logo.demo img {
    width: 70px;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.6));
    transition: transform 0.3s ease;
}

.app-brand:hover .app-brand-logo img {
    transform: scale(1.1) rotate(5deg);
}

/* Navigation */
.menu-inner .menu-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 1.5px;
    margin: 1.5rem 0 0.5rem 0;
    font-weight: 700;
}

.menu-inner .menu-item .menu-link {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 14px 18px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-inner .menu-item .menu-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.menu-inner .menu-item.active>.menu-link {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: var(--accent-blue);
    box-shadow: inset 2px 0 0 0 var(--accent-blue);
}

.menu-inner .menu-item.active .menu-icon {
    color: #60a5fa;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.5));
}

/* Header/Navbar */
.layout-navbar {
    background: rgba(15, 20, 30, 0.8) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    position: sticky !important;
    top: 0;
    z-index: 1050;
    width: 100%;
    transform: translateZ(0);
    /* Force hardware acceleration */
    will-change: transform;
    /* Hint to browser for optimization */
}

.layout-navbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
    opacity: 0.5;
}

/* Page Title */
.page-title-dark {
    font-family: var(--font-display);
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    white-space: nowrap;
    background: linear-gradient(135deg, #fff 0%, #a5f3fc 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.3));
}

/* Breadcrumb */
.breadcrumb-dark {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.breadcrumb-dark .active {
    color: var(--accent-blue);
}

/* Buttons */
.btn-dark-theme {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

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

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

.btn-dark-theme:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

/* Content Area */
.content-wrapper {
    background: transparent;
}

/* FAQ Styling */
.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.faq-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-blue);
    opacity: 0;
    transition: opacity 0.3s;
}

.faq-item.active {
    border-color: rgba(59, 130, 246, 0.4);
    background-color: rgba(30, 41, 59, 0.6);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.faq-item.active::before {
    opacity: 1;
}

.faq-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
}

.faq-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    transition: color 0.3s;
}

.faq-item.active .faq-title {
    color: var(--accent-cyan);
}

.faq-icon {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    transition: transform 0.3s ease, color 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: var(--accent-blue);
}

.faq-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
}

.faq-item.active .faq-body {
    max-height: 500px;
    opacity: 1;
}

.faq-content {
    padding: 0 2rem 2rem 2rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Section Headers */
.section-header-dark {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* Cards */
.card-dark {
    background-color: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-dark:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Footer */
.page-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    padding: 2rem 0;
    border-top: 1px solid var(--bg-card-border);
    margin-top: auto;
    opacity: 0.6;
}

/* Scrollbar */
.layout-page::-webkit-scrollbar {
    width: 8px;
}

.layout-page::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.layout-page::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

.layout-page::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* Form Styles */
.form-label {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control {
    background-color: rgba(15, 20, 30, 0.6);
    border: 1px solid var(--bg-card-border);
    color: #fff;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    background-color: rgba(30, 41, 59, 0.6);
    border-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Card Header Fix */
.card-dark .card-header {
    background: transparent;
    border-bottom: 1px solid var(--bg-card-border);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.2rem;
    padding: 1.5rem;
}

/* Primary Button (Neon Purple) */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #5b5ee0 0%, #9333ea 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.6);
    color: #fff;
}

/* Profile Tabs (List Group) */
.list-group-item {
    background-color: rgba(15, 20, 30, 0.4);
    border: 1px solid var(--bg-card-border);
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
    margin-right: 5px;
    border-radius: 8px !important;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #fff;
    border-color: rgba(59, 130, 246, 0.3);
}

.list-group-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    border-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

/* Dark Tables */
.card-dark .table {
    color: var(--text-secondary);
    border-color: var(--bg-card-border);
}

.card-dark .table th,
.card-dark .table td {
    border-color: var(--bg-card-border);
    background: transparent;
    padding: 1rem 1.5rem;
}

.card-dark .table th {
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.card-dark .table tr:hover td {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.02);
}

/* Message list styles */
.read-message-row {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

.table tr.cursor-pointer:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    cursor: pointer;
}

.table td.align-middle {
    vertical-align: middle !important;
}

.table thead th {
    text-transform: uppercase;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Premium Modal Styles */
.modal-content-dark {
    background: rgba(15, 20, 30, 0.75) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 1.5rem !important;
    color: #fff !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.modal-content-dark .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 2rem;
}

.modal-content-dark .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 2rem;
}

.modal-content-dark .modal-title {
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-content-dark .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-body-scroll {
    max-height: 60vh;
    overflow-y: auto;
    padding: 2rem !important;
}

.modal-body-scroll::-webkit-scrollbar {
    width: 6px;
}

.modal-body-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Premium Buttons */
.btn-premium-cyan {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.btn-premium-cyan:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.5) !important;
    filter: brightness(1.1);
}

.btn-premium-green {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    animation: pulse-green 3s infinite;
}

.btn-premium-green:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.5) !important;
    filter: brightness(1.1);
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

.btn-premium-gray {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    border-radius: 0.5rem !important;
}

.btn-premium-gray:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}

/* Message Detail View Styles */
.msg-meta-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

.msg-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.msg-sender-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.msg-sender-info h6 {
    margin: 0;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.msg-sender-email {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.msg-date {
    margin-left: auto;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
}

.msg-content-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.msg-subject {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    display: block;
}

.msg-body {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Authentication Page Styles */
.authentication-wrapper {
    background: radial-gradient(circle at top right, #1a202c, #0f141e) !important;
}

.auth-card {
    background: rgba(20, 25, 40, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    border-radius: 1.5rem !important;
}

.auth-card .card-body {
    padding: 3rem !important;
}

.auth-card .app-brand-text {
    color: #fff !important;
    font-size: 1.75rem !important;
    letter-spacing: 0.5px;
}

.auth-card h4 {
    color: #fff !important;
    font-weight: 700 !important;
}

.auth-card p {
    color: rgba(255, 255, 255, 0.6) !important;
}

.auth-card .form-label {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
}

.auth-card .form-control {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.auth-card .form-control:focus {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: #00d2ff !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 210, 255, 0.15) !important;
}

.auth-card .input-group-text {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-left: none !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

.auth-card .form-check-label {
    color: rgba(255, 255, 255, 0.7) !important;
}

.auth-card a {
    color: #00d2ff !important;
    transition: all 0.2s ease;
}

.auth-card a:hover {
    color: #3a7bd5 !important;
    text-decoration: none !important;
}

.auth-card .btn-primary {
    /* Use the generic btn-premium-cyan style instead, applied via class in HTML */
    /* But if btn-primary is used, override it just in case */
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3) !important;
}

/* Telegram Floating Button */
.telegram-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    box-shadow: 0 4px 15px rgba(34, 158, 217, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.telegram-float:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(34, 158, 217, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, #33c0ff 0%, #2ab5f5 100%);
}

.telegram-float svg {
    width: 30px;
    height: 30px;
    fill: #fff;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
    margin-right: -2px;
    /* Visual adjustment */
    margin-top: 2px;
}

/* Optional Pulse Animation */
.telegram-float::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid rgba(42, 171, 238, 0.5);
    animation: telegram-pulse 2s infinite;
    z-index: -1;
}

@keyframes telegram-pulse {
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Lawyer Block Utilities */
.bg-gradient-primary {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

.feature-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-size: 1.25rem;
}
