/* =============================================================================
   COMMON STYLES - Shared between admin interface and game
   Game design system takes priority
   ============================================================================= */

/* Game Design System Variables */
:root {
    /* Game color palette */
    --fertilizer-color: #f2e2b3;
    --crop-color: #23b99a;
    --locust-color: #e74c3c;
    --card-back-color: #BBEBFE;
    --board-color: #AAB29E;
    
    /* Primary colors derived from game */
    --primary-color: var(--crop-color);
    --primary-hover: #1ea082;
    --secondary-color: var(--fertilizer-color);
    --danger-color: var(--locust-color);
    --info-color: var(--card-back-color);
    
    /* Layout constraints from game */
    --max-width: 1200px;
    --card-spacing: 30px;
    
    /* Typography from game - responsive scaling */
    --title-size: clamp(1.2rem, 1.5vw, 1.8rem);
    --label-size: clamp(0.9rem, 1.0vw, 1.0rem);
    
    /* Common UI colors */
    --text-color: #333;
    --text-muted: #666;
    --border-color: #ddd;
    --background-light: #f9f9f9;
    --background-white: white;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-strong: 0 4px 20px rgba(0, 0, 0, 0.3);
    
    /* Disabled states */
    --disabled-bg: #abc995;
    --disabled-text: #3a4a40;
}

/* Global reset matching game */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: var(--label-size);
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-color);
}

/* Common button styling - based on game design */
.button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
    font-size: var(--label-size);
}

.button:hover:not(.disabled) {
    opacity: 0.9;
}

.button:active {
    transform: scale(0.98);
}

.button.disabled {
    cursor: not-allowed;
    opacity: 0.8;
    background-color: var(--disabled-bg);
    color: var(--disabled-text);
    transform: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Consent form specific styling */
#consent-text-box {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

#consent-text-box::-webkit-scrollbar {
    width: 8px;
}

#consent-text-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#consent-text-box::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#consent-text-box::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#consent-text-box h4 {
    color: #2c3e50;
    margin: 20px 0 10px 0;
    font-size: 1.1em;
}

#consent-text-box p, #consent-text-box li {
    margin-bottom: 10px;
}

#consent-text-box ul {
    margin-left: 20px;
}

#consent-checkbox {
    transition: opacity 0.3s ease;
}

/* Common form styling - aligned with game typography */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-color);
    font-size: var(--label-size);
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: var(--label-size);
}

.form-group input[type="number"] {
    width: 120px;
}

/* Common message styling - using game colors */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: var(--label-size);
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: var(--label-size);
}

/* Common loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Common tab styling - used by both game dialogs and admin interface */
.dialog-tabs, .admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-button {
    background: none;
    border: 2px solid var(--primary-color);
    padding: 8px 16px;
    font-size: var(--label-size);
    cursor: pointer;
    color: var(--primary-color);
    border-radius: 4px;
    transition: all 0.2s;
}

.tab-button:hover {
    background-color: #f0f0f0;
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-button:active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}