/* CertiFried MultiTool - Unified Dark Theme */

/* Base Styles */
:root {
    --gradient-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --gradient-accent: linear-gradient(135deg, #e94560 0%, #533483 100%);
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.95);  /* Improved from 0.85 for better contrast */
    --text-muted: rgba(255, 255, 255, 0.85);      /* Improved from 0.7 for better readability */
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Bootstrap overrides for better contrast */
.text-muted {
    color: var(--text-muted) !important;
}

.lead {
    color: var(--text-secondary);
}

small, .small {
    color: var(--text-secondary);
}

body {
    background: var(--gradient-primary);
    min-height: 100vh;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Container Styles */
.container-fluid {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    max-width: 1400px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.page-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
}

/* Page Headers */
.page-header {
    background: var(--gradient-accent);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(233, 69, 96, 0.3);
}

.page-header h1 {
    color: #fff;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-header .lead {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(233, 69, 96, 0.5);
}

.card-header {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.2) 0%, rgba(83, 52, 131, 0.2) 100%);
    border-bottom: 1px solid var(--card-border);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1.25rem;
    border-radius: 15px 15px 0 0 !important;
}

.card-body {
    padding: 1.5rem;
    color: var(--text-secondary);
}

.card-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Content Cards */
.content-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    margin-bottom: 25px;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(233, 69, 96, 0.5);
}

/* Stat Cards */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.6);
    background: linear-gradient(135deg, #ff5277 0%, #6a4d9a 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    box-shadow: 0 4px 15px rgba(235, 51, 73, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

/* Form Controls */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    padding: 12px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(233, 69, 96, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(233, 69, 96, 0.25);
    color: #ffffff;
}

.form-select option {
    background: #1a1a2e;
    color: #ffffff;
}

.form-control:disabled,
.form-select:disabled {
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.5);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
}

.navbar-brand {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.2);
}

.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.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
    color: var(--text-secondary);
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #ffffff;
    background: rgba(233, 69, 96, 0.2);
}

/* Tables */
.table {
    color: var(--text-primary);
}

.table thead th {
    background: var(--card-bg);
    border-bottom: 2px solid var(--card-border);
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.table td, .table th {
    vertical-align: middle;
    padding: 1rem;
    color: var(--text-primary);
}

/* Badges */
.badge {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

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

.badge-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.badge-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.badge-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.badge-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Alerts */
.alert {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

.alert-success {
    border-left: 4px solid #38ef7d;
}

.alert-danger {
    border-left: 4px solid #eb3349;
}

.alert-warning {
    border-left: 4px solid #f5576c;
}

.alert-info {
    border-left: 4px solid #4facfe;
}

/* List Groups */
.list-group-item {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 15px;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

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

/* Modals */
/* Prevent page shift when modal opens */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important; /* Prevent Bootstrap from adding padding */
}

.modal {
    z-index: 1055 !important;
    pointer-events: auto !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1056 !important;
    pointer-events: auto !important;
    max-height: 90vh;
    display: flex;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    z-index: 1057 !important;
    pointer-events: auto !important;
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--card-border);
    pointer-events: auto !important;
    flex-shrink: 0;
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--card-border);
    pointer-events: auto !important;
    flex-shrink: 0;
    padding: 1.5rem;
    gap: 0.5rem;
}

.modal-title {
    color: var(--text-primary);
}

.modal-body {
    color: var(--text-primary);
    flex: 1;
    min-height: 0;
    max-height: calc(90vh - 150px);
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
    padding: 1.5rem;
}

.modal .form-control,
.modal .form-select,
.modal textarea,
.modal input,
.modal button,
.modal select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    pointer-events: auto !important;
    position: relative;
    z-index: 2;
}

.modal .form-control:focus,
.modal .form-select:focus,
.modal textarea:focus,
.modal input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(233, 69, 96, 0.5);
    color: #ffffff;
    pointer-events: auto !important;
    outline: none;
}

.modal .btn {
    pointer-events: auto !important;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.modal .card {
    pointer-events: auto !important;
    position: relative;
}

/* Dropdown */
.dropdown-menu {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.dropdown-item {
    color: var(--text-primary);
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(233, 69, 96, 0.3);
    color: #ffffff;
}

.dropdown-item.active {
    background: var(--gradient-accent);
    color: #ffffff;
}

/* Progress Bars */
.progress {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    height: 12px;
}

.progress-bar {
    background: var(--gradient-accent);
    border-radius: 10px;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(233, 69, 96, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(233, 69, 96, 0.7);
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Utility Classes */
.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
}

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

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

/* Footer */
footer {
    background-color: rgba(26, 26, 46, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

footer .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .page-container {
        padding: 15px;
        margin: 20px auto;
    }

    .page-header {
        padding: 25px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .modal-dialog {
        margin: auto;
        max-height: 95vh;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-body {
        max-height: calc(95vh - 120px);
    }

    .content-card {
        padding: 20px;
    }
}
