/* Domain Categories Styles */

#kg-domain-categories-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.kg-domain-section {
    border: 2px solid #17a2b8;
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    background: #e3f7fc;
    position: relative;
}

/* Domain Management Styles */
#kg-domain-management {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    border: 1px solid #dee2e6;
}

#kg-domain-management h3 {
    margin: 0 0 10px 0;
    color: #495057;
}

#kg-domain-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 200px;
    font-size: 14px;
}

#kg-domain-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.kg-domain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.kg-domain-item:hover {
    border-color: #007bff;
}

.kg-domain-checkbox {
    transform: scale(1.2);
    cursor: pointer;
}

#kg-domains-list {
    margin-top: 15px;
}

.kg-btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.kg-btn-primary:hover {
    background-color: #0056b3;
    text-decoration: none;
    color: white;
}

/* Responsive design for domain management */
@media (max-width: 768px) {
    #kg-domain-management {
        padding: 15px;
    }
    
    #kg-domain-management > div {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    #kg-domain-input {
        min-width: auto;
        width: 100%;
    }
}

.kg-category-set {
    background: white;
    margin: 15px 0;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kg-organic-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
}

.kg-local-pack-section {
    background: #fff3e0;
    padding: 15px;
    border-radius: 6px;
    border: 2px solid #ff9800;
    border-left: 4px solid #f57c00;
}

.kg-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.kg-metric-box {
    background: white;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.kg-metric-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.kg-metric-value {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.kg-metric-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.kg-chart-container {
    margin: 20px 0;
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kg-clickstream-section {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.kg-clickstream-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.kg-change-indicator {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
    margin-left: 8px;
}

.kg-domain-header {
    transition: background-color 0.2s ease;
}

.kg-domain-header:hover {
    background-color: rgba(23, 162, 184, 0.1);
    border-radius: 4px;
}

.kg-domain-navigation button {
    transition: all 0.2s ease;
}

.kg-domain-navigation button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.kg-change-indicator.new {
    background: #28a745;
}

.kg-change-indicator.up {
    background: #17a2b8;
}

.kg-change-indicator.down {
    background: #ffc107;
    color: #000;
}

.kg-status-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.kg-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.kg-domain-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.kg-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kg-section-title {
    color: #17a2b8;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kg-subsection-title {
    color: #495057;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kg-organic-title {
    color: #28a745;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kg-local-title {
    color: #f57c00;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Upload form styles */
.kg-upload-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin: 20px 0;
}

.kg-file-input {
    margin: 10px 0;
}

.kg-upload-btn {
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.kg-upload-btn:hover {
    background-color: #218838;
}

.kg-upload-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Responsive design */
@media (max-width: 768px) {
    #kg-domain-categories-container {
        padding: 10px;
    }
    
    .kg-metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .kg-clickstream-charts {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .kg-domain-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .kg-metric-box {
        padding: 10px;
    }
    
    .kg-metric-value {
        font-size: 1.4em;
    }
}

@media (max-width: 480px) {
    .kg-metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .kg-section-title {
        font-size: 1.2em;
    }
    
    .kg-subsection-title,
    .kg-organic-title,
    .kg-local-title {
        font-size: 1.1em;
    }
}

/* Loading states */
.kg-loading-domain {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.kg-loading-domain::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #17a2b8;
    border-radius: 50%;
    animation: kg-domain-spin 1s linear infinite;
}

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

/* Success/Error messages */
.kg-domain-message {
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    font-weight: 500;
}

.kg-domain-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.kg-domain-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.kg-domain-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Improved chart containers */
.kg-chart-container canvas {
    max-height: 300px !important;
    height: 300px !important;
}

.kg-clickstream-section canvas {
    max-height: 200px !important;
    height: 200px !important;
}

/* Category ID badge */
.kg-category-id {
    background: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-left: 8px;
    font-weight: normal;
}

/* Enhanced metric boxes with colors */
.kg-metric-box.primary .kg-metric-value {
    color: #007bff;
}

.kg-metric-box.success .kg-metric-value {
    color: #28a745;
}

.kg-metric-box.danger .kg-metric-value {
    color: #dc3545;
}

.kg-metric-box.warning .kg-metric-value {
    color: #ffc107;
}

.kg-metric-box.info .kg-metric-value {
    color: #17a2b8;
}

.kg-metric-box.orange .kg-metric-value {
    color: #f57c00;
}