/* Tor Email - Custom Styles */

/* CSS Variables for Theme */
:root {
    --primary-color: #1a2332;
    --secondary-color: #4f46e5;
    --accent-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --neutral-color: #6b7280;
    --bg-light: #f9fafb;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 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);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #ffffff;
}

.font-monospace {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* Text Gradient Effect */
.text-gradient {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--bg-light) 0%, #ffffff 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-title {
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* Verification Stats Card */
.verification-stats-card {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.stat-item {
    padding: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--bg-light);
}

.upload-area:hover,
.upload-area.border-primary {
    border-color: var(--secondary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--secondary-color);
}

/* Verification Controls */
.verification-controls {
    border-top: 1px solid var(--border-color);
}

/* Progress Section */
.progress-section {
    background: var(--bg-light);
}

.progress {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    animation: progress-glow 3s ease-in-out infinite;
}

@keyframes progress-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.progress-bar {
    background: linear-gradient(90deg,
        var(--secondary-color) 0%,
        #4338ca 25%,
        var(--accent-color) 50%,
        #059669 75%,
        var(--secondary-color) 100%);
    background-size: 200% 100%;
    animation: progress-flow 2s linear infinite, progress-pulse 1.5s ease-in-out infinite;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.3);
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent);
    animation: progress-shine 1.5s ease-in-out infinite;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 70%);
    background-size: 20px 20px;
    animation: progress-stripes 0.8s linear infinite;
}

@keyframes progress-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes progress-pulse {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.1); }
}

@keyframes progress-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes progress-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

/* Different progress bar states */
.progress-bar.processing {
    animation: progress-flow 2s linear infinite, progress-pulse 1.5s ease-in-out infinite;
}

.progress-bar.completed {
    background: linear-gradient(90deg, #10b981, #059669);
    animation: progress-completed 0.5s ease-out;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

@keyframes progress-completed {
    0% { transform: scaleY(1); }
    50% { transform: scaleY(1.2); }
    100% { transform: scaleY(1); }
}

/* Progress container with glow effect */
.progress-container {
    position: relative;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.progress-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
        var(--secondary-color),
        var(--accent-color),
        var(--warning-color));
    border-radius: 14px;
    z-index: -1;
    opacity: 0;
    animation: progress-container-glow 3s ease-in-out infinite;
}

@keyframes progress-container-glow {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.3; }
}

/* Smooth transitions */
.progress-bar {
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.current-status {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

/* Statistics Cards */
.stat-card {
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
/* Enhanced Progress Styles */
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mini-progress {
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.mini-progress .progress-bar {
    transition: width 0.5s ease;
}

/* Progress animation enhancements */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Statistics enhancements */
.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Real-time updates indicator */
.stat-card.updating {
    animation: pulse-update 0.5s ease-in-out;
}

@keyframes pulse-update {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Progress details styling */
#progressDetails {
    font-weight: 600;
    color: #495057;
}

#currentStatus {
    font-weight: 500;
    color: #6c757d;
}

#currentEmail {
    font-size: 0.875rem;
    color: #868e96;
}

/* Enhanced responsive design */
@media (max-width: 768px) {
    .stat-card {
        padding: 0.75rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .mini-progress {
        height: 3px;
    }
}
}

/* Results Section */
.results-section {
    background: var(--bg-light);
}

#resultsTable {
    font-size: 0.875rem;
}

#resultsTable th {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

#resultsTable td {
    vertical-align: middle;
}

/* Features Section */
.features-section {
    background: var(--bg-light);
}

.feature-card {
    background: white;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.feature-icon i {
    font-size: 3rem;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-color) !important;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), #4338ca);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca, var(--secondary-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-color), #059669);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, var(--accent-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Cards */
.card {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Badges */
.badge {
    font-weight: 500;
    border-radius: 6px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: var(--shadow-md);
}

.alert-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.alert-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.alert-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.alert-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0f172a 100%) !important;
    position: relative;
    overflow: hidden;
}

/* Ensure all footer text is white */
footer,
footer * {
    color: #ffffff !important;
}

/* Override Bootstrap text color variables for footer */
footer {
    --bs-secondary-color: #ffffff !important;
    --bs-text-opacity: 1 !important;
}

/* Specific override for footer description */
footer p.footer-description {
    color: #ffffff !important;
    --bs-text-opacity: 1 !important;
    --bs-secondary-color: #ffffff !important;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.3), transparent);
}

footer .container {
    position: relative;
    z-index: 1;
}

footer h5 {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    position: relative;
}

footer h5::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 1px;
}

/* Ensure first column text is white */
footer .col-lg-4:first-child h5,
footer .col-lg-4:first-child p,
footer .col-md-6:first-child h5,
footer .col-md-6:first-child p {
    color: #ffffff !important;
}

footer p {
    color: #ffffff !important;
    line-height: 1.6;
}

footer .footer-description {
    color: #ffffff !important;
}

/* Override Bootstrap's text-muted rule specifically for footer */
footer p.text-muted {
    --bs-text-opacity: 1 !important;
    color: #ffffff !important;
}

footer ul.list-unstyled {
    padding: 0;
}

footer ul.list-unstyled li {
    margin-bottom: 0.5rem;
}

footer ul.list-unstyled li a {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.25rem 0;
    border-radius: 4px;
    position: relative;
}

footer ul.list-unstyled li a:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    padding-left: 0.5rem;
    transform: translateX(2px);
}

footer ul.list-unstyled li a::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.7);
    transition: width 0.3s ease;
}

footer ul.list-unstyled li a:hover::before {
    width: 6px;
}

footer hr.bg-secondary {
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.2), transparent) !important;
    border: none;
    height: 1px;
    margin: 2rem 0;
}

footer .row:last-child {
    padding-top: 1rem;
}

footer .row:last-child p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

@media (max-width: 768px) {
    footer {
        text-align: center;
        padding: 2rem 0;
    }

    footer h5::after {
        left: 50%;
        transform: translateX(-50%);
    }

    footer .col-md-6 {
        margin-bottom: 2rem;
    }

    footer ul.list-unstyled li a:hover {
        padding-left: 0;
        transform: none;
    }

    footer ul.list-unstyled li a::before {
        display: none;
    }
}

@media (max-width: 992px) {
    footer .col-lg-3 {
        margin-bottom: 2rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .verification-controls .row {
        gap: 1rem;
    }
    
    .verification-controls .text-md-end {
        text-align: left !important;
    }
    
    #resultsTable {
        font-size: 0.75rem;
    }
    
    .feature-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes animate-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.animate-pulse {
    animation: animate-pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-color);
}

/* Print Styles */
@media print {
    .navbar,
    .hero-section,
    .features-section,
    .docs-section,
    footer,
    .verification-controls,
    .progress-section {
        display: none !important;
    }
    
    .results-section {
        display: block !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --secondary-color: #0066cc;
        --accent-color: #008000;
        --text-dark: #000000;
        --border-color: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Footer Enhancements */
.footer-link {
    position: relative;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.25rem 0;
}

.footer-link:hover {
    transform: translateX(5px);
}


/* Waiting Animation for Progress Bar */
.waiting-animation {
    position: relative;
    overflow: hidden;
}

.waiting-animation::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: waiting-shimmer 1.5s infinite;
}

@keyframes waiting-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Enhanced Progress Bar Animation */
.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 1rem 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* Dark mode support (prepared for future implementation) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1f2937;
        --text-dark: #f9fafb;
        --text-muted: #9ca3af;
        --border-color: #374151;
    }

    body {
        background-color: #111827;
        color: var(--text-dark);
    }

    .card {
        background-color: #1f2937;
        border-color: var(--border-color);
    }

    .upload-area {
        background-color: #374151;
    }
}

/* Dropdown Submenu Styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    margin-left: -1px;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Show submenu on hover for desktop */
@media (min-width: 992px) {
    .dropdown-submenu:hover .dropdown-menu {
        display: block;
    }
    
    .dropdown-submenu .dropdown-toggle::after {
        display: inline-block;
        margin-left: 0.255em;
        vertical-align: 0.255em;
        content: "";
        border-top: 0.3em solid;
        border-right: 0.3em solid transparent;
        border-bottom: 0;
        border-left: 0.3em solid transparent;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
}

/* Mobile submenu handling */
@media (max-width: 991.98px) {
    .dropdown-submenu .dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 0;
        margin-left: 0;
        border: none;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.05);
        padding-left: 1rem;
    }
    
    .dropdown-submenu .dropdown-toggle::after {
        border-top: 0.3em solid transparent;
        border-right: 0.3em solid;
        border-bottom: 0.3em solid transparent;
        border-left: 0;
        margin-left: 0.255em;
    }
}