/* Open Sans Regular (400) */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/OpenSans-Regular.woff2') format('woff2');
}

/* Open Sans Semi-Bold (600) */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/OpenSans-SemiBold.woff2') format('woff2');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #f5f5f5;
    font-size: 13px;
    padding-top: 42px;
    margin: 0;
    color: #333;
}

/* Fixed Header */
.custom-header {
    background-color: #8A2422;
    height: 42px;
    color: white;
    font-family: 'Open Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    display: flex;
    align-items: center;
    width: 100%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.header-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 35px;
    box-sizing: border-box;
}

.header-wrapper {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 30px;
}

.ku-title-link {
    color: white;
    text-decoration: none;
    font-size: 24px;
    font-weight: 400;
    transition: all 0.3s ease;
}

.ku-title-link strong {
    font-weight: 700;
    letter-spacing: -0.5px;
    font-size: 28px;
}

.ku-title-link:hover {
    color: white;
    text-decoration: none;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s ease;
    padding: 8px 12px;
}

.nav-link:hover {
    color: white;
    text-decoration: none;
}

.nav-link.active {
    color: white;
    font-weight: 600;
    border-bottom: 2px solid white;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 35px;
    box-sizing: border-box;
}

main {
    background: #f5f5f5;
    padding: 25px 0;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Cards */
.card {
    background: white;
    padding: 25px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.card h2, .card h3 {
    color: #8A2422;
    font-weight: 600;
    margin-bottom: 15px;
}

.card h2 {
    font-size: 1.5rem;
}

.card h3 {
    font-size: 1.3rem;
}

.card h4 {
    color: #495057;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* Form Controls */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0 16px;
    border: 1px solid #000000;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    height: 40px;
    line-height: 40px;
    font-family: 'Open Sans', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: #8A2422;
}

select.form-control {
    background-color: white;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0 30px;
    height: 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: #8A2422;
    color: white;
}

.btn-primary:hover {
    background: #6A1C1A;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 0 20px;
    height: 40px;
    font-size: 0.95rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table thead {
    background: #f8f9fa;
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background: #f8f9fa;
    cursor: pointer;
}

/* Badges */
.badge {
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-primary {
    background: #8A2422;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

/* Keyword Tags */
.kw-tag {
    font-size: 0.9rem;
    padding: 6px 12px;
    margin: 3px;
    display: inline-block;
    background: #fff;
    color: #333;
    border: 1px solid #ced4da;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.kw-remove {
    margin-left: 8px;
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
}

.kw-remove:hover {
    color: #c82333;
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    margin-top: 15px;
}

.trend-container {
    position: relative;
    height: 500px;
    width: 100%;
    margin-top: 15px;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8A2422;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Alert Messages */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert-light {
    background: #fefefe;
    border-color: #e9ecef;
    color: #6c757d;
    text-align: center;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.text-primary {
    color: #8A2422;
}

.fw-bold {
    font-weight: 600;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: 10px;
}

.mb-3 {
    margin-bottom: 15px;
}

.mb-4 {
    margin-bottom: 20px;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 15px;
}

.p-3 {
    padding: 15px;
}

.p-4 {
    padding: 20px;
}

.bg-light {
    background-color: #f8f9fa;
}

.border {
    border: 1px solid #dee2e6;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.text-end {
    text-align: right;
}

/* Links */
a {
    color: #8A2422;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #6A1C1A;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .container {
        padding: 0 20px;
    }

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