﻿/* theme.css - Theme Switching System for KEA Application */

/* Base Theme (Default) */
:root {
    --theme-primary: #AF12B0;
    --theme-primary-dark: #1B608E;
    --theme-primary-light: rgba(175, 18, 176, 0.1);
    --theme-background: #f8f9fa;
    --theme-surface: #ffffff;
    --theme-text-primary: #333333;
    --theme-text-secondary: #666666;
    --theme-border: rgba(175, 18, 176, 0.1);
    --theme-shadow: rgba(175, 18, 176, 0.1);
    --theme-gradient: linear-gradient(90deg, #AF12B0 0%, #1B608E 75%);
    --theme-success: #27ae60;
    --theme-error: #e74c3c;
    --theme-warning: #f39c12;
    --theme-info: #3498db;
}

/* Blue Theme */
[data-theme="blue"] {
    --theme-primary: #1B608E;
    --theme-primary-dark: #0D4A75;
    --theme-primary-light: rgba(27, 96, 142, 0.1);
    --theme-background: #f0f8ff;
    --theme-surface: #ffffff;
    --theme-text-primary: #1a365d;
    --theme-text-secondary: #4a5568;
    --theme-border: rgba(27, 96, 142, 0.1);
    --theme-shadow: rgba(27, 96, 142, 0.1);
    --theme-gradient: linear-gradient(90deg, #1B608E 0%, #0D4A75 75%);
    --theme-success: #27ae60;
    --theme-error: #e74c3c;
    --theme-warning: #f39c12;
    --theme-info: #3498db;
}

/* Green Theme */
[data-theme="green"] {
    --theme-primary: #27ae60;
    --theme-primary-dark: #219653;
    --theme-primary-light: rgba(39, 174, 96, 0.1);
    --theme-background: #f0fff4;
    --theme-surface: #ffffff;
    --theme-text-primary: #22543d;
    --theme-text-secondary: #2d3748;
    --theme-border: rgba(39, 174, 96, 0.1);
    --theme-shadow: rgba(39, 174, 96, 0.1);
    --theme-gradient: linear-gradient(90deg, #27ae60 0%, #219653 75%);
    --theme-success: #2ecc71;
    --theme-error: #e74c3c;
    --theme-warning: #f39c12;
    --theme-info: #3498db;
}

/* Red Theme */
[data-theme="red"] {
    --theme-primary: #e74c3c;
    --theme-primary-dark: #c0392b;
    --theme-primary-light: rgba(231, 76, 60, 0.1);
    --theme-background: #fff5f5;
    --theme-surface: #ffffff;
    --theme-text-primary: #742a2a;
    --theme-text-secondary: #2d3748;
    --theme-border: rgba(231, 76, 60, 0.1);
    --theme-shadow: rgba(231, 76, 60, 0.1);
    --theme-gradient: linear-gradient(90deg, #e74c3c 0%, #c0392b 75%);
    --theme-success: #27ae60;
    --theme-error: #c0392b;
    --theme-warning: #f39c12;
    --theme-info: #3498db;
}

/* Theme Switching UI */
.theme-switcher-container {
    position: fixed;
    top: 80px; /* Positioned below the header */
    right: 20px;
    z-index: 1050;
}

.theme-toggle-btn {
    background: var(--theme-gradient);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 3px 6px var(--theme-shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

    .theme-toggle-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 10px var(--theme-shadow);
    }

.theme-colors {
    display: none;
    background: var(--theme-surface);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    margin-top: 10px;
    position: absolute;
    right: 0;
    min-width: 180px;
    z-index: 1060;
}

    .theme-colors.show {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

.color-option {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .color-option:hover {
        transform: scale(1.1);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    }

    .color-option.active {
        border-color: var(--theme-text-primary);
        transform: scale(1.05);
    }

    .color-option[data-theme="default"] {
        background: linear-gradient(45deg, #AF12B0, #1B608E);
    }

    .color-option[data-theme="blue"] {
        background: linear-gradient(45deg, #1B608E, #0D4A75);
    }

    .color-option[data-theme="green"] {
        background: linear-gradient(45deg, #27ae60, #219653);
    }

    .color-option[data-theme="red"] {
        background: linear-gradient(45deg, #e74c3c, #c0392b);
    }

/* Theme Application Classes */
.theme-background {
    background-color: var(--theme-background);
}

.theme-surface {
    background-color: var(--theme-surface);
    color: var(--theme-text-primary);
}

.theme-gradient-bg {
    background: var(--theme-gradient);
    color: white;
}

.theme-primary {
    color: var(--theme-primary);
}

.theme-border {
    border-color: var(--theme-border);
}

.theme-shadow {
    box-shadow: 0 4px 15px var(--theme-shadow);
}

/* Form Specific Theme Classes */
.theme-form-control {
    border: 2px solid var(--theme-border);
    background-color: var(--theme-surface);
    color: var(--theme-text-primary);
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

    .theme-form-control:focus {
        border-color: var(--theme-primary);
        box-shadow: 0 0 0 0.25rem var(--theme-primary-light);
        outline: none;
    }

.theme-button-primary {
    background: var(--theme-gradient);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--theme-shadow);
    cursor: pointer;
    font-family: inherit;
}

    .theme-button-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px var(--theme-shadow);
        color: white;
    }

    .theme-button-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

.theme-card {
    background: var(--theme-surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--theme-border);
    margin-bottom: 2rem;
}

.theme-section-header {
    background: var(--theme-gradient);
    border-radius: 12px 12px 0 0;
    padding: 1.5rem;
    margin: -2rem -2rem 2rem -2rem;
    color: white;
}

/* ================================================
   RESPONSIVE DESIGN - ALL SCREEN SIZES
   ================================================ */

/* Extra extra small devices (phones, less than 375px) */
@media (max-width: 374.98px) {
    .theme-switcher-container {
        top: 70px;
        right: 10px;
    }

    .theme-toggle-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

        .theme-toggle-btn span {
            display: none;
        }

        .theme-toggle-btn i {
            margin: 0;
            font-size: 0.9rem;
        }

    .theme-colors {
        right: 0;
        min-width: 160px;
        padding: 10px;
    }

    .color-option {
        width: 30px;
        height: 30px;
    }
}

/* Extra small devices (phones, 375px to 424.98px) */
@media (min-width: 375px) and (max-width: 424.98px) {
    .theme-switcher-container {
        top: 72px;
        right: 12px;
    }

    .theme-toggle-btn {
        padding: 6px 14px;
        font-size: 0.82rem;
    }

    .theme-colors {
        right: 0;
        min-width: 170px;
        padding: 12px;
    }
}

/* Small devices (landscape phones, 425px to 575.98px) */
@media (min-width: 425px) and (max-width: 575.98px) {
    .theme-switcher-container {
        top: 75px;
        right: 15px;
    }

    .theme-toggle-btn {
        padding: 7px 16px;
        font-size: 0.85rem;
    }
}

/* Medium devices (tablets, 576px to 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .theme-switcher-container {
        top: 78px;
        right: 18px;
    }

    .theme-toggle-btn {
        padding: 8px 18px;
        font-size: 0.88rem;
    }
}

/* Large devices (desktops, 768px to 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .theme-switcher-container {
        top: 80px;
        right: 20px;
    }
}

/* Extra large devices (large desktops, 992px to 1199.98px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .theme-switcher-container {
        top: 82px;
        right: 22px;
    }
}

/* Extra extra large devices (1200px and up) */
@media (min-width: 1200px) {
    .theme-switcher-container {
        top: 85px;
        right: 25px;
    }
}

/* Specific screen size optimizations */
/* iPhone SE (375x667) and similar */
@media (width: 375px) and (height: 667px) {
    .theme-switcher-container {
        top: 70px;
        right: 10px;
    }
}

/* iPhone 14 (390x844) and similar */
@media (width: 390px) and (height: 844px) {
    .theme-switcher-container {
        top: 72px;
        right: 12px;
    }
}

/* Samsung Galaxy (360x740) */
@media (width: 360px) and (height: 740px) {
    .theme-switcher-container {
        top: 68px;
        right: 8px;
    }

    .theme-toggle-btn {
        padding: 5px 10px;
    }
}

/* iPad Pro 12.9" (1024x1366) */
@media (width: 1024px) and (height: 1366px) {
    .theme-switcher-container {
        top: 90px;
        right: 30px;
    }

    .theme-toggle-btn {
        padding: 10px 25px;
        font-size: 1rem;
    }
}

/* Surface Duo (540x720) */
@media (width: 540px) and (height: 720px) {
    .theme-switcher-container {
        top: 76px;
        right: 16px;
    }
}

/* Nest Hub (1024x600) */
@media (width: 1024px) and (height: 600px) {
    .theme-switcher-container {
        top: 78px;
        right: 20px;
    }
}

/* Desktop (1200x800) */
@media (width: 1200px) and (height: 800px) {
    .theme-switcher-container {
        top: 84px;
        right: 24px;
    }
}

/* Theme Transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Ensure smooth theme transitions for specific elements */
body,
.theme-card,
.theme-form-control,
.theme-button-primary,
.theme-section-header {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
