/* =============================================
   PDF TO VOICE CONVERTER - ROYAL BLUE THEME
   ============================================= */

/* ===== BASE STYLES ===== */
:root {
    --royal-blue: #003366;
    --royal-blue-dark: #002244;
    --royal-blue-light: #4169E1;
    --royal-gradient: linear-gradient(135deg, #003366 0%, #002244 100%);
    --royal-gradient-light: linear-gradient(135deg, #4169E1 0%, #003366 100%);
    --silver: #c0c0c0;
    --silver-light: #e0e0e0;
    --silver-dark: #a0a0a0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    color: #333333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1400px;
    padding: 20px 30px;
    margin: 0 auto;
}

/* ===== FOOTER STYLES ===== */
.footer {
    background: linear-gradient(135deg, #0b1d3a 0%, #000000 100%);
    color: #e0e0e0;
    padding: 2rem 0;
    margin-top: auto;
    width: 100%;
    flex-shrink: 0;
}

.footer h5 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #ffffff;
}

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

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

/* ===== NAVIGATION ===== */
.navbar {
    background: var(--royal-gradient);
    box-shadow: 0 2px 15px rgba(0, 51, 102, 0.15);
    padding: 0.5rem 0;
    min-height: 70px;
}

.navbar .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    padding: 0;
}

.navbar-brand img {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-brand span {
    margin-left: 0.5rem;
    white-space: nowrap;
}

.navbar-nav {
    display: flex;
    align-items: center;
    flex-direction: row;
    margin-left: auto;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    margin: 0 0.1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.25rem;
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 0.75rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
}

.navbar-collapse.show,
.navbar-collapse.collapsing {
    display: block !important;
}

.dropdown-menu {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    color: #333333;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background: rgba(0, 51, 102, 0.1);
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--royal-gradient);
    border: 2px solid transparent;
}

.btn-primary:hover {
    background: var(--royal-gradient-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.25);
}

.btn-outline-primary {
    color: var(--royal-blue);
    border: 2px solid var(--royal-blue);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--royal-blue);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--royal-gradient-light);
    border: 2px solid transparent;
}

.btn-success:hover {
    background: var(--royal-gradient);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

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

/* ===== CARDS ===== */
.card {
    border: 1px solid var(--silver-light);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 51, 102, 0.1);
    transform: translateY(-3px);
}

.card-header {
    background: linear-gradient(145deg, #0b2e6b, #020617);
    color: var(--royal-blue);
    font-weight: 600;
    border-bottom: 2px solid var(--royal-blue);
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-header.primary {
    background: linear-gradient(135deg, #0b2e6b 0%, #020617 100%);
}

/* ===== ROYAL STAT CARDS (Dashboard) ===== */
.royal-card {
    background: linear-gradient(145deg, #0b2e6b, #020617);
    border-radius: 12px;
    border-left: 5px solid #1e40af;
    color: #ffffff;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.royal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
}

.royal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(30, 64, 175, 0.4);
}

.royal-title {
    color: #c7d2fe;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.royal-value {
    color: #ffffff;
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0;
}

.royal-icon {
    color: #d1d5db;
    font-size: 2.5rem;
    opacity: 0.8;
}

.royal-spin {
    animation: royalSpin 1.5s linear infinite;
}

.royal-blue-black {
    background: linear-gradient(135deg, #0b1d3a 0%, #000000 100%);
    color: #ffffff;
    border-bottom: 2px solid #1e40af;
}

@keyframes royalSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== ACTIVE CONVERSION CARD ===== */
.active-conversion-card {
    border-left: 4px solid var(--royal-blue-light);
    background: linear-gradient(to right, #f0f8ff, #ffffff);
}

.queue-badge {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* ===== PROGRESS BARS ===== */
.progress {
    height: 1.25rem;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--royal-blue), var(--royal-blue-light));
    transition: width 0.6s ease;
    border-radius: 10px;
}

.progress-container {
    position: relative;
    margin: 1rem 0;
}

.progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* ===== FORMS ===== */
.form-control {
    border: 2px solid var(--silver-light);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    width: 100%;
}

.form-control:focus {
    border-color: var(--royal-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 51, 102, 0.15);
    background: #ffffff;
}

.form-label {
    color: var(--royal-blue);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.form-select {
    border: 2px solid var(--silver-light);
    border-radius: 8px;
    padding: 0.75rem;
    background-color: #ffffff;
    width: 100%;
}

.form-select:focus {
    border-color: var(--royal-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 51, 102, 0.15);
}

.form-range {
    width: 100%;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 10px;
    border: none;
    border-left: 4px solid;
    padding: 1rem 1.5rem;
    animation: fadeInDown 0.5s ease;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.alert-info {
    background-color: #e6f2ff;
    border-left-color: var(--royal-blue);
    color: var(--royal-blue);
}

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

/* ===== TABLES ===== */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--royal-blue);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 2px solid var(--royal-blue);
    text-align: left;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--silver-light);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(0, 51, 102, 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Mobile responsive table */
.table-responsive-custom {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== BADGES ===== */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 600;
    border-radius: 6px;
    font-size: 0.75em;
    display: inline-block;
}

.status-badge {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    display: inline-block;
}

.badge-converted {
    background: linear-gradient(135deg, #0f3d91, #08162f);
    color: #ffffff;
}

.badge-processing {
    background: linear-gradient(135deg, #1a4fc5, #000000);
    color: #e6e6e6;
    animation: pulseGlow 1.6s infinite;
}

.badge-default {
    background: linear-gradient(135deg, #1c1c1c, #000000);
    color: #cccccc;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 rgba(15, 61, 145, 0.4); }
    50% { box-shadow: 0 0 10px rgba(15, 61, 145, 0.8); }
    100% { box-shadow: 0 0 0 rgba(15, 61, 145, 0.4); }
}

/* ===== MODALS ===== */
.modal-content {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid var(--royal-blue);
    padding: 1.5rem;
}

.modal-title {
    color: var(--royal-blue);
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--silver-light);
    padding: 1rem 1.5rem;
}

.modal-footer .btn {
    margin: 0 0.25rem;
}

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

/* ===== LIST GROUPS ===== */
.list-group-item {
    border: none;
    border-bottom: 1px solid var(--silver-light);
    padding: 1rem;
    background: transparent;
    transition: all 0.3s ease;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: rgba(0, 51, 102, 0.05);
    transform: translateX(5px);
}

.list-group-item-action {
    cursor: pointer;
}

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 3px dashed var(--silver-light);
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--royal-blue);
    background: #e6f2ff;
}

.upload-area.dragover {
    border-color: var(--royal-blue);
    background: #e6f2ff;
    transform: scale(1.02);
}

/* ===== FEATURE CARDS (Index Page) ===== */
.feature-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--silver-light);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 51, 102, 0.15);
    border-color: var(--royal-blue);
}

.feature-icon {
    background: var(--royal-gradient);
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
}

/* ===== TIMELINE (History Page) ===== */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--royal-blue), var(--royal-blue-light));
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -40px;
    top: 0;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 3px solid var(--royal-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--royal-blue);
    font-weight: bold;
}

.timeline-content {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--royal-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* ===== VOICE CLONER PAGE ===== */
.voice-model-card {
    background: #ffffff;
    border: 2px solid var(--silver-light);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.voice-model-card:hover {
    border-color: var(--royal-blue);
    box-shadow: 0 10px 30px rgba(0, 51, 102, 0.1);
}

.sample-item {
    border: 2px dashed var(--silver-light);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.sample-item:hover {
    border-color: var(--royal-blue);
    background: #e6f2ff;
}

.sample-item.active {
    border-color: var(--royal-blue);
    background: #e6f2ff;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.training-status {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 1rem;
}

.training-status.training {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.training-status.trained {
    background: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

.training-status.failed {
    background: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
}

/* ===== ADMIN DASHBOARD STYLES ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: bold;
    color: #4CAF50;
}

.stat-card.users .value { color: #2196F3; }
.stat-card.files .value { color: #FF9800; }
.stat-card.conversions .value { color: #9C27B0; }

.admin-badge {
    background: #e3f2fd;
    color: #2196F3;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ===== LIBRARY PAGE STYLES ===== */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.file-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.file-info small {
    color: #6c757d;
}

.audio-player-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
}

.play-btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===== UTILITY CLASSES ===== */
.text-royal-blue {
    color: var(--royal-blue) !important;
}

.text-silver {
    color: var(--silver) !important;
}

.bg-royal-gradient {
    background: var(--royal-gradient) !important;
}

.border-royal {
    border-color: var(--royal-blue) !important;
}

.shadow-royal {
    box-shadow: 0 10px 30px rgba(0, 51, 102, 0.15) !important;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--silver), var(--silver-dark));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--silver-dark), #808080);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ===== MOBILE RESPONSIVE STYLES ===== */

/* Large Tablet (up to 992px) */
@media (max-width: 992px) {
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-brand img {
        height: 50px;
    }
}

/* Tablet (up to 768px) */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .feature-card,
    .voice-model-card {
        padding: 1.5rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .timeline {
        padding-left: 30px;
    }
    
    .timeline::before {
        left: 15px;
    }
    
    .timeline-marker {
        left: -30px;
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    /* Admin dashboard responsive */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .stat-card .value {
        font-size: 28px;
    }
    
    /* Library responsive */
    .action-buttons {
        justify-content: flex-start;
    }
    
    .action-buttons .btn {
        flex: 0 0 auto;
    }
    
    /* Footer responsive */
    .footer .col-lg-4,
    .footer .col-lg-2,
    .footer .col-lg-3 {
        margin-bottom: 1.5rem;
    }
    
    /* Dashboard stat cards */
    .royal-card {
        padding: 1.25rem;
    }
    
    .royal-value {
        font-size: 1.75rem;
    }
}

/* Mobile (up to 576px) */
@media (max-width: 576px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.2rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    .container {
        padding: 15px 10px;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    /* Navbar */
    .navbar {
        padding: 0.5rem 0;
        min-height: 60px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-brand img {
        height: 40px;
    }
    
    .navbar-brand span {
        display: none;
    }
    
    .navbar-collapse {
        margin-top: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .navbar-toggler {
        padding: 0.4rem 0.6rem;
    }
    
    /* Dashboard */
    .conversion-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .conversion-item h6 {
        font-size: 0.95rem;
    }
    
    .conversion-percentage {
        font-size: 1.1rem;
    }
    
    .progress {
        height: 20px;
    }
    
    /* Footer */
    .footer {
        padding: 1.5rem 0;
        text-align: center;
    }
    
    .footer h5 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .footer .social-links {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .footer .text-md-start {
        text-align: center !important;
    }
    
    .footer .text-md-end {
        text-align: center !important;
        margin-top: 0.5rem;
    }
    
    /* Back to top button */
    #backToTop {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    /* Quick actions */
    .quick-actions-grid .col-md-3 {
        margin-bottom: 1rem;
    }
}

/* Extra small devices (up to 400px) */
@media (max-width: 400px) {
    .container {
        padding: 10px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        height: 35px;
    }
    
    .royal-value {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card .value {
        font-size: 24px;
    }
    
    h1 { font-size: 1.35rem; }
    h2 { font-size: 1.2rem; }
}

/* Large screens */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
        break-inside: avoid;
    }
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus {
    outline: 3px solid rgba(0, 51, 102, 0.5);
    outline-offset: 2px;
}

/* ===== LOADING STATES ===== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--royal-blue);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== CUSTOM SELECT ===== */
.custom-select {
    position: relative;
}

.custom-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23003366' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

/* ===== FINAL TOUCHES ===== */
.rounded-lg {
    border-radius: 15px !important;
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.shadow-md {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.hover-lift:hover {
    transform: translateY(-3px);
    transition: transform 0.3s ease;
}

.cursor-pointer {
    cursor: pointer;
}

.user-select-none {
    user-select: none;
}

/* Verification logo styles */
.verification-logo-container {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: inline-block;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.verification-logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.verification-logo:hover {
    transform: scale(1.05);
}

/* Conversion item styles */
.conversion-item {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.conversion-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.conversion-controls .btn {
    flex: 0 0 auto;
    margin-bottom: 0;
    width: auto;
}

/* Navbar dropdown mobile fix */
@media (max-width: 991px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #003366 0%, #002244 100%);
        padding: 1rem;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        max-height: 80vh;
        overflow-y: auto;
        z-index: 1000;
    }
    
    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        display: block !important;
    }
    
    .navbar-nav {
        flex-direction: column !important;
        align-items: stretch;
        margin: 0 !important;
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.25rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 8px;
        font-size: 1rem !important;
        display: flex;
        align-items: center;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background: rgba(255, 255, 255, 0.15) !important;
    }
    
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin-top: 0.5rem;
        background-color: #002244;
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        padding: 0.5rem 0;
        min-width: 200px;
    }
    
    .navbar-nav .dropdown-menu .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        border-radius: 4px;
        margin: 0 0.5rem;
    }
    
    .navbar-nav .dropdown-menu .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }
    
    .navbar-nav .dropdown-menu .dropdown-divider {
        border-color: rgba(255, 255, 255, 0.15);
        margin: 0.5rem 0;
    }
    
    /* User dropdown toggle */
    .navbar-nav .nav-item.dropdown .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .navbar-nav .nav-item.dropdown .nav-link::after {
        display: inline-block;
        margin-left: 0.5rem;
        vertical-align: middle;
        content: "";
        border-top: 0.3em solid rgba(255, 255, 255, 0.8);
        border-right: 0.3em solid transparent;
        border-bottom: 0;
        border-left: 0.3em solid transparent;
    }
    
    .navbar-nav .dropdown-menu.show {
        display: block;
        position: relative;
    }
    
    /* Login/Register buttons in mobile */
    .navbar-nav .nav-item .btn-outline-light {
        width: 100%;
        margin: 0.5rem 0;
        padding: 0.75rem 1rem;
        text-align: center;
        justify-content: center;
    }
}

/* Table mobile enhancements */
@media (max-width: 767px) {
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Modal mobile optimizations */
@media (max-width: 575px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 10px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        flex: 1;
    }
}

/* Form mobile enhancements */
@media (max-width: 575px) {
    .form-control,
    .form-select {
        font-size: 16px;
    }
    
    .form-range {
        height: 6px;
    }
}

/* List group mobile enhancements */
@media (max-width: 575px) {
    .list-group-item {
        padding: 0.75rem;
    }
    
    .list-group-item h6 {
        font-size: 0.9rem;
    }
    
    .list-group-item small {
        font-size: 0.8rem;
    }
}

/* Alert mobile */
.flashed-messages .alert {
    padding-right: 2.5rem;
}

/* Badge mobile */
@media (max-width: 575px) {
    .badge {
        font-size: 0.7em;
        padding: 0.25em 0.5em;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Progress bar mobile */
@media (max-width: 575px) {
    .progress-container {
        margin: 0.75rem 0;
    }
    
    .progress-text {
        font-size: 0.75rem;
    }
}

/* Notification container mobile */
@media (max-width: 575px) {
    #notificationsContainer {
        width: calc(100% - 40px);
        right: 10px !important;
        left: 10px !important;
    }
}

/* Social links */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Quick actions grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.quick-actions-grid .btn {
    height: 100%;
    min-height: 100px;
}

@media (max-width: 991px) {
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid .btn {
        min-height: 80px;
        width: 100%;
    }
}

/* File info on table */
.table td .file-info {
    min-width: 150px;
}

/* Audio player */
audio {
    width: 100%;
    margin-top: 0.5rem;
}

/* Form groups */
.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* Row and column utilities */
.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-auto, .col-sm, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-auto,
.col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md-auto,
.col-lg, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-auto,
.col-xl, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-auto {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Spacing utilities */
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-3 { margin-left: 1rem; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }
.my-3 { margin-top: 1rem; margin-bottom: 1rem; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }

.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-start { text-align: left; }
.text-end { text-align: right; }
.text-muted { color: #6c757d; }
.text-white { color: #ffffff !important; }
.text-danger { color: #dc3545 !important; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }

/* Display utilities */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.flex-fill { flex: 1 1 auto; }
.flex-grow-1 { flex-grow: 1; }

/* Position utilities */
.position-fixed { position: fixed; }
.position-relative { position: relative; }
.fixed-top { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; }
.fixed-bottom { position: fixed; right: 0; bottom: 0; left: 0; z-index: 1030; }

/* Width and height utilities */
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.vh-100 { height: 100vh; }

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Border utilities */
.border { border: 1px solid #dee2e6; }
.border-top { border-top: 1px solid #dee2e6; }
.border-bottom { border-bottom: 1px solid #dee2e6; }
.border-light { border-color: #f8f9fa !important; }
.rounded { border-radius: 0.25rem; }
.rounded-circle { border-radius: 50%; }
.rounded-pill { border-radius: 50rem; }

/* Grid system */
@media (min-width: 576px) {
    .col-sm { flex: 1 0 0%; }
    .col-sm-auto { flex: 0 0 auto; width: auto; }
    .col-sm-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-sm-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-sm-3 { flex: 0 0 auto; width: 25%; }
    .col-sm-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-sm-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .col-sm-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-sm-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-sm-9 { flex: 0 0 auto; width: 75%; }
    .col-sm-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-sm-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 768px) {
    .col-md { flex: 1 0 0%; }
    .col-md-auto { flex: 0 0 auto; width: auto; }
    .col-md-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 992px) {
    .col-lg { flex: 1 0 0%; }
    .col-lg-auto { flex: 0 0 auto; width: auto; }
    .col-lg-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 1200px) {
    .col-xl { flex: 1 0 0%; }
    .col-xl-auto { flex: 0 0 auto; width: auto; }
    .col-xl-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-xl-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-xl-3 { flex: 0 0 auto; width: 25%; }
    .col-xl-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-xl-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-xl-6 { flex: 0 0 auto; width: 50%; }
    .col-xl-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-xl-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-xl-9 { flex: 0 0 auto; width: 75%; }
    .col-xl-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-xl-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-xl-12 { flex: 0 0 auto; width: 100%; }
}

/* Visibility utilities */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* Z-index utilities */
.z-index-0 { z-index: 0; }
.z-index-1 { z-index: 100; }
.z-index-1000 { z-index: 1000; }
.z-index-9999 { z-index: 9999; }

/* ===== TRANSLATOR PAGE STYLES ===== */
/* Royal Blue & White Theme */
:root {
    --translator-primary: #4169E1;
    --translator-primary-dark: #1e40af;
    --translator-secondary: #2c5282;
    --translator-accent: #1d4ed8;
    --translator-gradient-start: #4169E1;
    --translator-gradient-end: #1e40af;
}

.translator-container {
    max-width: 1200px;
    margin: 0 auto;
}

.translator-header {
    text-align: center;
    margin-bottom: 30px;
}

.translator-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--translator-primary-dark), var(--translator-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.translator-header p {
    color: #6c757d;
    font-size: 1.1rem;
}

.language-selector {
    background: linear-gradient(135deg, var(--translator-gradient-end), var(--royal-blue-dark));
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    color: white;
}

.language-selector label {
    color: white;
    font-weight: 500;
}

.input-method-tabs {
    margin-bottom: 20px;
}

.input-method-tabs .nav-link {
    color: var(--translator-primary);
    border: 2px solid var(--translator-primary);
    margin-right: 10px;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
}

.input-method-tabs .nav-link.active {
    background: var(--translator-primary);
    color: white;
}

.translation-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .translation-area {
        grid-template-columns: 1fr;
    }
}

.text-area-wrapper {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(65, 105, 225, 0.15);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.text-area-header {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--translator-primary-dark);
}

.text-area-header i {
    margin-right: 10px;
    color: var(--translator-primary);
}

.text-area-body {
    padding: 0;
}

textarea.form-control {
    border: none;
    resize: none;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
    min-height: 300px;
}

textarea.form-control:focus {
    box-shadow: none;
}

.translation-controls {
    text-align: center;
    margin-bottom: 30px;
}

.translate-btn {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--translator-gradient-start), var(--translator-gradient-end));
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(65, 105, 225, 0.4);
}

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(65, 105, 225, 0.6);
}

.translate-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.char-count {
    font-size: 12px;
    color: #6c757d;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    text-align: center;
}

.spinner i {
    font-size: 50px;
    color: var(--translator-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner p {
    margin-top: 15px;
    font-size: 18px;
    color: #1e40af;
    font-weight: 500;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.quick-action-btn {
    padding: 5px 15px;
    font-size: 12px;
    border-radius: 20px;
    border: 1px solid var(--translator-primary);
    background: white;
    color: var(--translator-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: var(--translator-primary);
    color: white;
    border-color: var(--translator-primary);
}

.result-info {
    background: #dbeafe;
    color: #1e40af;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 10px;
    display: none;
    border-left: 4px solid var(--translator-primary);
}

.result-info.show {
    display: block;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-download:hover:not(:disabled) {
    background: #1e3a5f;
}

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

.btn-audio:hover:not(:disabled) {
    background: var(--translator-primary-dark);
}

.btn-save-library {
    background: #6366f1;
    color: white;
}

.btn-save-library:hover:not(:disabled) {
    background: #4f46e5;
}

.pdf-upload-area {
    border: 2px dashed var(--translator-primary);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    background: #eff6ff;
    transition: all 0.3s ease;
}

.pdf-upload-area:hover {
    background: #dbeafe;
    border-color: var(--translator-secondary);
}

.pdf-upload-area.dragover {
    background: #bfdbfe;
    border-color: var(--translator-primary);
}

.pdf-upload-area i {
    font-size: 48px;
    color: var(--translator-primary);
    margin-bottom: 15px;
}

.pdf-list {
    max-height: 300px;
    overflow-y: auto;
}

.pdf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    background: white;
}

.pdf-item:hover {
    background: #f8fafc;
    border-color: var(--translator-primary);
}

.pdf-item.selected {
    background: #eff6ff;
    border-color: var(--translator-primary);
}

.pdf-item i {
    color: #ef4444;
    margin-right: 10px;
}

.pdf-item .pdf-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-item .pdf-date {
    font-size: 12px;
    color: #6c757d;
    margin-left: 10px;
}

.uploaded-pdf-info {
    background: #eff6ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #bfdbfe;
}

.uploaded-pdf-info i {
    font-size: 24px;
    color: var(--translator-primary);
    margin-right: 15px;
}

.tab-content {
    padding: 20px 0;
}

/* ===== LIBRARY PAGE STYLES ===== */
/* Royal Blue & White Theme */

/* iOS Modal Fixes - Full screen modal for mobile */
@media (max-width: 768px) {
    .modal {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }
    
    .modal-dialog {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        height: 100% !important;
        display: flex !important;
        align-items: flex-end !important;
    }
    
    .modal-content {
        border-radius: 20px 20px 0 0 !important;
        min-height: auto !important;
        height: auto !important;
        max-height: calc(100vh - 50px) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
        margin-bottom: 0 !important;
    }
    
    .modal-header {
        flex-shrink: 0 !important;
        padding: 1rem 1.25rem !important;
    }
    
    .modal-body {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 1.25rem !important;
        max-height: calc(100vh - 200px) !important;
        touch-action: pan-y !important;
        overscroll-behavior-y: contain !important;
    }
    
    .modal-footer {
        flex-shrink: 0 !important;
        padding: 1rem 1.25rem !important;
    }
}

/* Disable tap highlights for better iOS experience */
button, a, .btn, .voice-model-card, .default-voice-btn, .convert-btn {
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
}

/* Better touch feedback */
.btn:active, .voice-model-card:active {
    opacity: 0.8 !important;
    transform: scale(0.98) !important;
    transition: transform 0.1s ease, opacity 0.1s ease !important;
}

/* Voice model grid for better mobile display */
.voice-model-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 12px !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding: 8px !important;
    -webkit-overflow-scrolling: touch !important;
}

@media (max-width: 576px) {
    .voice-model-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 8px !important;
    }
}

@media (max-width: 400px) {
    .voice-model-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
}

/* Voice Card Popup Selection - Mobile Card Style */
.voice-model-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
}

.voice-model-cards:active {
    cursor: grabbing;
}

.voice-card {
    display: flex !important;
    align-items: center !important;
    padding: 14px 16px !important;
    background: #ffffff !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 12px !important;
    width: 100% !important;
    text-align: left !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
}

.voice-card:hover {
    border-color: var(--translator-primary) !important;
    box-shadow: 0 4px 15px rgba(65, 105, 225, 0.15) !important;
}

.voice-card.selected {
    border-color: var(--translator-primary) !important;
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.08) 0%, rgba(30, 64, 175, 0.05) 100%) !important;
}

.voice-card.selected .voice-card-check i {
    display: block !important;
    color: var(--translator-primary) !important;
}

.voice-card-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.4rem !important;
    flex-shrink: 0 !important;
}

.voice-card-info {
    flex: 1 !important;
    padding: 0 12px !important;
    min-width: 0 !important;
}

.voice-card-info h6 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    color: #333 !important;
}

.voice-card-info small {
    font-size: 0.8rem !important;
}

.voice-card-check {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
}

.voice-card-check i {
    font-size: 1.4rem !important;
}

/* Custom voice card */
.custom-voice-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
}

.custom-voice-card .voice-card-info h6,
.custom-voice-card .voice-card-info small {
    color: #ffffff !important;
}

.custom-voice-card.selected {
    background: linear-gradient(135deg, #4169E1 0%, #1e40af 100%) !important;
    box-shadow: 0 4px 20px rgba(65, 105, 225, 0.4) !important;
}

.custom-voice-card .voice-card-icon {
    background: rgba(255, 255, 255, 0.2) !important;
}

.custom-voice-card.selected .voice-card-check i {
    color: #ffffff !important;
}

/* Mobile specific voice card styles */
@media (max-width: 576px) {
    .voice-model-cards {
        gap: 8px;
    }
    
    .voice-card {
        padding: 12px 14px !important;
        border-radius: 10px !important;
    }
    
    .voice-card-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem !important;
    }
    
    .voice-card-info {
        padding: 0 10px !important;
    }
    
    .voice-card-info h6 {
        font-size: 0.95rem !important;
    }
    
    .voice-card-info small {
        font-size: 0.75rem !important;
    }
}

@media (max-width: 400px) {
    .voice-card {
        padding: 10px 12px !important;
    }
    
    .voice-card-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
    }
    
    .voice-card-info h6 {
        font-size: 0.9rem !important;
    }
}

/* Voice model card styling */
.voice-model-card {
    cursor: pointer !important;
    padding: 14px !important;
    border-radius: 12px !important;
    border: 2px solid #e0e0e0 !important;
    background: #fff !important;
    width: 100% !important;
    text-align: left !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    overflow: hidden !important;
    margin: 0 !important;
    display: block !important;
    min-height: 90px !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
}

@media (max-width: 576px) {
    .voice-model-card {
        padding: 12px !important;
        min-height: 85px !important;
        border-radius: 10px !important;
    }
}

@media (max-width: 400px) {
    .voice-model-card {
        padding: 10px !important;
        min-height: 80px !important;
    }
}

.voice-model-card:hover {
    border-color: var(--translator-primary) !important;
    box-shadow: 0 4px 15px rgba(65, 105, 225, 0.1) !important;
}

.voice-model-card.selected {
    border-color: var(--translator-primary) !important;
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.1) 0%, rgba(30, 64, 175, 0.05) 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(65, 105, 225, 0.4) !important;
}

/* Action buttons spacing for mobile */
.action-buttons {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.action-buttons .btn-sm {
    min-width: 40px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Table responsive improvements */
.table-responsive-custom {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 8px !important;
    margin: 0 -10px !important;
    padding: 0 10px !important;
}

@media (max-width: 768px) {
    .table-responsive-custom {
        margin: 0 -15px !important;
        padding: 0 15px !important;
    }
}

/* Modal backdrop fix for iOS */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1040 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #000 !important;
}

/* Mobile form select improvements */
@media (max-width: 576px) {
    .form-select {
        font-size: 16px !important;
        padding: 0.75rem 1rem !important;
        min-height: 48px !important;
        -webkit-appearance: none !important;
        appearance: none !important;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%234169E1' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3e%3c/svg%3e") !important;
        background-repeat: no-repeat !important;
        background-position: right 0.75rem center !important;
        background-size: 16px 12px !important;
        padding-right: 2.5rem !important;
    }
}
