:root {
    --primary-blue: #4a6fa5;
    --light-blue: #e8f4f8;
    --dark-blue: #166088;
    --accent-blue: #6ab8e6;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #d1e3f0;
    --shadow: rgba(74, 111, 165, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f4f8 100%);
    color: var(--text-dark);
    min-height: 100vh;
    padding-bottom: 20px;
}

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Styling */
header {
    background: linear-gradient(to right, var(--primary-blue), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    padding: 15px 20px;
    font-weight: 600;
}

/* Textarea Styling */
#textInput {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#textInput:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 0.25rem rgba(106, 184, 230, 0.25);
    outline: none;
}

/* Button Styling */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-primary, .btn-outline-primary:hover {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline-primary:hover {
    color: white;
}

.btn-outline-success {
    color: #28a745;
    border-color: #28a745;
}

.btn-outline-success:hover {
    background-color: #28a745;
    color: white;
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid var(--accent-blue);
    box-shadow: 0 4px 6px var(--shadow);
    height: 100%;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
}

.stat-title {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 5px;
}

/* Tab Styling */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-blue);
    background-color: var(--light-blue);
}

.nav-tabs .nav-link.active {
    color: var(--primary-blue);
    background-color: white;
    border-bottom: 3px solid var(--primary-blue);
}

/* Table Styling */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--primary-blue);
    border-bottom: 2px solid var(--border-color);
    background-color: var(--light-blue);
}

.table td {
    border-color: var(--border-color);
    vertical-align: middle;
}

/* Preview Box */
#textPreview {
    line-height: 1.6;
    color: var(--text-dark);
}

/* Responsive Design */
@media (max-width: 992px) {
    .container-fluid {
        padding: 0 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 15px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .d-flex.flex-wrap {
        justify-content: center;
    }
    
    .form-check {
        margin-top: 10px;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 576px) {
    h1.display-5 {
        font-size: 2rem;
    }
    
    .card-header h5 {
        font-size: 1.1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* Animation for stats update */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.5s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

/* File Processing Alert */
#fileProcessing {
    min-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    padding-top: 20px;
}

footer a {
    color: var(--primary-blue) !important;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline !important;
}