/* Main Variables */
:root {
    --primary-color: #002147;
    --secondary-color: #ffc107;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --border-radius-lg: 15px;
    --border-radius-sm: 8px;
    --border-radius-xl: 30px;
    --transition-default: all 0.3s ease;
}

/* Base Styles */
body {
    background-color: var(--light-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: #001a38;
    border-color: #001a38;
}

.btn-warning {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background-color: #e5ac00;
    border-color: #e5ac00;
    color: var(--primary-color);
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #003b80 100%);
    color: white;
    padding: 3rem 0;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-section p {
    opacity: 0.9;
    font-size: 1.2rem;
}

/* Search Components */
.search-box {
    border-radius: var(--border-radius-xl);
    border: 2px solid var(--secondary-color);
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.search-box:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
    border-color: var(--secondary-color);
}

.search-btn {
    background-color: var(--secondary-color);
    border: none;
    color: var(--primary-color);
    font-weight: bold;
    border-radius: var(--border-radius-xl);
    padding: 0.8rem 2rem;
    transition: var(--transition-default);
    box-shadow: var(--shadow-md);
}

.search-btn:hover {
    background-color: #ffcf26;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.search-btn:active {
    transform: translateY(0);
}

.country-select {
    border-radius: var(--border-radius-xl);
    border: 2px solid #ddd;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    background-color: white;
}

/* Platform Tabs */
.platform-tabs {
    border-bottom: 2px solid var(--primary-color);
}

.platform-tabs .nav-link {
    color: var(--primary-color);
    font-weight: 600;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    margin-right: 1rem;
    padding: 0.8rem 0.5rem;
    border-radius: 0;
}

.platform-tabs .nav-link.active {
    border-bottom: 3px solid var(--secondary-color);
    color: var(--primary-color);
    background-color: transparent;
    font-weight: 700;
}

.platform-tabs .nav-link:hover {
    border-bottom: 3px solid var(--secondary-color);
    background-color: rgba(0, 33, 71, 0.05);
}

.platform-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Results Card */
.results-card {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-default);
    border: none;
}

.results-card:hover {
    transform: translateY(-5px);
}

.results-card .card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-bottom: none;
}

.results-card .card-header h5 {
    font-weight: 600;
}

.results-card .badge {
    font-weight: 500;
}

.results-card .table th {
    border-top: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 1rem;
}

.results-card .table td {
    padding: 0.75rem 1rem;
}

.results-card .table tr:hover {
    background-color: rgba(0, 33, 71, 0.03);
}

/* Keyword Difficulty Badges */
.kd-badge-easy {
    background-color: var(--success-color);
    color: white;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.kd-badge-medium {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.kd-badge-hard {
    background-color: var(--danger-color);
    color: white;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Suggestions Table */
.keyword-suggestions {
    max-height: 500px;
    overflow-y: auto;
}

.keyword-suggestions::-webkit-scrollbar {
    width: 8px;
}

.keyword-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.keyword-suggestions::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.keyword-suggestions::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Filter Section */
.filter-section {
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    border-top: 4px solid var(--primary-color);
}

.filter-section h5 {
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.filter-btn {
    border-radius: var(--border-radius-xl);
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-right: 0.25rem;
}

.filter-btn.btn-outline-success {
    color: var(--success-color);
    border-color: var(--success-color);
}

.filter-btn.btn-outline-success:hover, .filter-btn.btn-outline-success.active {
    background-color: var(--success-color);
    color: white;
}

.filter-btn.btn-outline-warning {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.filter-btn.btn-outline-warning:hover, .filter-btn.btn-outline-warning.active {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.filter-btn.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.filter-btn.btn-outline-danger:hover, .filter-btn.btn-outline-danger.active {
    background-color: var(--danger-color);
    color: white;
}

.filter-section .form-label {
    font-weight: 600;
    color: var(--primary-color);
    opacity: 0.8;
    margin-bottom: 0.75rem;
}

.filter-section .form-check-label {
    font-weight: 500;
    color: #555;
}

.filter-section .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Counter Boxes */
.counter-box {
    text-align: center;
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-default);
    border-bottom: 3px solid var(--primary-color);
}

.counter-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.counter-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.counter-label {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    opacity: 0.8;
}

/* AI Suggestion Cards */
.ai-suggestion-card {
    border-left: 5px solid var(--secondary-color);
    margin-bottom: 0.75rem;
    transition: var(--transition-default);
    box-shadow: var(--shadow-sm);
}

.ai-suggestion-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(3px);
}

.ai-suggestion-card .card-body {
    padding: 0.75rem 1rem;
}

.ai-suggestion-card .text-muted {
    color: #495057 !important;
    font-size: 0.9rem;
}

/* Loading Animation */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
}

.loading-spinner .spinner-border {
    color: var(--secondary-color) !important;
    width: 3rem;
    height: 3rem;
}

/* Initial Message */
.initial-message {
    padding: 2rem;
    font-size: 1.1rem;
    background-color: rgba(0, 33, 71, 0.05);
    border-left: 4px solid var(--primary-color);
    color: var(--primary-color);
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Transition Effects */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Button Active State */
.filter-btn.active {
    font-weight: bold;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .platform-tabs .nav-link {
        margin-right: 0.5rem;
        font-size: 0.9rem;
        padding: 0.6rem 0.4rem;
    }
    
    .platform-icon {
        font-size: 1.2rem;
    }
    
    .counter-number {
        font-size: 1.8rem;
    }
    
    .counter-label {
        font-size: 0.8rem;
    }
    
    .filter-section {
        position: sticky;
        top: 20px;
    }
    
    .search-box, .country-select, .search-btn {
        font-size: 1rem;
        padding: 0.7rem 1.2rem;
    }
}

@media (max-width: 767px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p.lead {
        font-size: 1rem;
    }
    
    .counter-box {
        margin-bottom: 1rem;
    }
    
    .platform-tabs {
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        padding-bottom: 5px;
    }
    
    .platform-tabs .nav-item {
        display: inline-block;
    }
    
    .platform-tabs .nav-link {
        padding: 0.5rem 0.8rem;
        margin-right: 0.3rem;
        font-size: 0.85rem;
    }
    
    .platform-icon {
        font-size: 1rem;
        margin-right: 0.3rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
}

@media (max-width: 575px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section p.lead {
        font-size: 0.9rem;
    }
    
    .keyword-text {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .results-card .card-header h5 {
        font-size: 1.1rem;
    }
    
    .filter-section h5 {
        font-size: 1.1rem;
    }
}