/*
 * Brinks Secure Vault Tracking - Custom CSS
 * Complements Tailwind CSS
 */

/* ============================================================
   CSS CUSTOM PROPERTIES (THEMING)
   ============================================================ */
:root {
    --primary: #1a2744;
    --secondary: #2c3e6b;
    --accent: #c9a84c;
    --bg-body: #f9fafb;
    --text-body: #1f2937;
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================================
   GLOBAL SMOOTH TRANSITIONS
   ============================================================ */
a,
button,
input,
select,
textarea,
img {
    transition: all var(--transition-base);
}

/* ============================================================
   1. CUSTOM SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 5px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

/* ============================================================
   2. LOADING SPINNER ANIMATION
   ============================================================ */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.spinner-white {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: white;
}

/* ============================================================
   3. TOAST NOTIFICATION STYLES
   ============================================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 24rem;
    width: calc(100vw - 2rem);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: var(--shadow-xl);
    border-left: 4px solid transparent;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--transition-base);
    pointer-events: auto;
    position: relative;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-success {
    border-left-color: #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-icon {
    flex-shrink: 0;
    font-size: 1.125rem;
    line-height: 1;
    margin-top: 1px;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-body);
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: #374151;
}

@media (max-width: 640px) {
    .toast-container {
        top: auto;
        bottom: 1rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
        width: auto;
    }
}

/* ============================================================
   4. HERO SLIDER STYLES
   ============================================================ */
.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 0;
    transition: opacity 700ms ease;
}

.hero-slide.active,
.hero-slide.active.opacity-100 {
    opacity: 1;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 39, 68, 0.9), rgba(44, 62, 107, 0.7));
}

.slide-transition {
    transition: opacity 700ms ease, transform 700ms ease;
}

.slide-progress {
    transition: width 5s linear;
    height: 3px;
    background-color: var(--accent);
    border-radius: 2px;
}

/* ============================================================
   5. PROGRESS TIMELINE STYLES
   ============================================================ */
.vault-timeline {
    padding: 0.5rem 0;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.timeline-step > div:first-child {
    background-color: #e5e7eb;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.timeline-step.completed > div:first-child {
    background-color: var(--accent);
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
}

.timeline-step.active > div:first-child {
    background-color: var(--accent);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.25), 0 4px 6px -1px rgba(0, 0, 0, 0.15);
    animation: timeline-pulse 2s ease-in-out infinite;
}

.timeline-step.future > div:first-child {
    background-color: #e5e7eb;
    color: #d1d5db;
}

.timeline-step span {
    color: #9ca3af;
}

.timeline-step.completed span,
.timeline-step.active span {
    color: var(--primary);
    font-weight: 700;
}

.timeline-step.future span {
    color: #d1d5db;
}

@keyframes timeline-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.25), 0 4px 6px -1px rgba(0, 0, 0, 0.15); }
    50% { box-shadow: 0 0 0 8px rgba(201, 168, 76, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.15); }
}

/* ============================================================
   6. MOBILE MENU ANIMATION STYLES
   ============================================================ */
.mobile-menu-panel {
    transition: transform 0.3s ease;
}

.mobile-menu-panel.open {
    transform: translateX(0);
}

.mobile-menu-panel.closed {
    transform: translateX(100%);
}

.hamburger-bar {
    display: block;
    width: 1.5rem;
    height: 2px;
    background-color: #374151;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-active .hamburger-bar:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.hamburger-active .hamburger-bar:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ============================================================
   7. CARD HOVER EFFECTS
   ============================================================ */
.card-hover {
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card-hover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.05), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
    border-radius: inherit;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-hover:hover::after {
    opacity: 1;
}

.card-hover:active {
    transform: translateY(-2px);
}

/* ============================================================
   8. BUTTON HOVER TRANSITIONS
   ============================================================ */
.btn-primary {
    background-color: var(--accent);
    color: var(--primary);
    font-weight: 700;
    padding: 0.625rem 1.5rem;
    border-radius: 9999px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px) scale(1.02);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background-color: var(--primary);
    color: white;
    font-weight: 700;
    padding: 0.625rem 1.5rem;
    border-radius: 9999px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px) scale(1.02);
    opacity: 0.9;
}

/* ============================================================
   9. FORM FOCUS STYLES
   ============================================================ */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15) !important;
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.763L10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.75rem;
    padding-right: 2.5rem;
}

/* ============================================================
   10. LOADING OVERLAY / SPINNER
   ============================================================ */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: inherit;
    backdrop-filter: blur(2px);
}

.loading-overlay-dark {
    background: rgba(26, 39, 68, 0.7);
}

.loading-dots {
    display: inline-flex;
    gap: 0.375rem;
    align-items: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
    animation: loading-bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes loading-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   11. CUSTOM UTILITY CLASSES (CORPORATE COLOR SCHEME)
   ============================================================ */
.text-primary-custom { color: var(--primary); }
.text-secondary-custom { color: var(--secondary); }
.text-accent-custom { color: var(--accent); }

.bg-primary-custom { background-color: var(--primary); }
.bg-secondary-custom { background-color: var(--secondary); }
.bg-accent-custom { background-color: var(--accent); }

.border-accent-custom { border-color: var(--accent); }

.gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.gradient-accent {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent), #e8c95a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================================
   12. PRINT STYLES
   ============================================================ */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    h1, h2, h3, h4 {
        page-break-after: avoid;
    }

    p {
        orphans: 3;
        widows: 3;
    }

    .toast-container,
    .scroll-to-top,
    #mobileMenu,
    #searchModal,
    #searchModalFooter,
    .loading-overlay,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }

    header {
        position: static !important;
    }

    .timeline-step.active > div:first-child {
        animation: none;
        box-shadow: none;
    }
}

/* ============================================================
   13. SCROLL TO TOP BUTTON
   ============================================================ */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-base);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.scroll-to-top:active {
    transform: translateY(0);
}

/* ============================================================
   14. MODAL STYLES
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 42rem;
    overflow: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all var(--transition-base);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

/* ============================================================
   15. ADMIN-SPECIFIC STYLES
   ============================================================ */
.admin-sidebar {
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-transition {
    transition: transform 0.3s ease;
}

.dashboard-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f3f4f6;
    transition: all var(--transition-base);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #e5e7eb;
}

.dashboard-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.dashboard-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.dashboard-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-table th {
    background-color: #f9fafb;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

.admin-table tbody tr:hover {
    background-color: #f9fafb;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================================
   16. VAULT RESULT CARD ANIMATIONS
   ============================================================ */
.vault-result-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

@keyframes vaultFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}