/* ===================================
   Themed Signatures Stylesheet
   Version: 1.0
   =================================== */

/* ===================================
   1. CSS VARIABLES FOR THEMING
   =================================== */

:root {
    /* Default theme variables (Standard) */
    --theme-primary: #17232D;
    --theme-secondary: #2C8248;
    --theme-accent: #ABDD65;
    --theme-divider: #2C8248;
    --theme-text: #17232D;
    --theme-link: #2C8248;
    --theme-decoration-intensity: 0.6;

    /* Layout variables */
    --theme-selector-height: 200px;
    --theme-preview-size: 40px;
}

/* ===================================
   2. THEMED PAGE STYLES
   =================================== */

body.themed-page {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    transition: background 0.5s ease;
}

/* Theme-specific backgrounds */
body.theme-christmas {
    background: linear-gradient(135deg, #0F4C5C 0%, #165B33 50%, #BB2528 100%);
}

body.theme-newYear {
    background: linear-gradient(135deg, #17232D 0%, #FFD700 50%, #C0C0C0 100%);
}

/* ===================================
   3. THEME SELECTOR
   =================================== */

.theme-selector {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.theme-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.theme-selector-header h3 {
    margin: 0;
    color: var(--theme-primary);
    font-size: 1.2em;
}

.auto-detect-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9em;
    color: #666;
}

.auto-detect-toggle input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Theme option buttons */
.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.theme-option {
    position: relative;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.theme-option:hover:not(:disabled) {
    border-color: var(--theme-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.theme-option.active {
    border-color: var(--theme-secondary);
    background: #f0f8f5;
    box-shadow: 0 2px 8px rgba(44, 130, 72, 0.2);
}

.theme-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.theme-preview {
    width: var(--theme-preview-size);
    height: var(--theme-preview-size);
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.theme-name {
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
}

.season-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--theme-accent);
    color: var(--theme-primary);
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* ===================================
   4. DECORATION LEVEL CONTROLS
   =================================== */

.decoration-level {
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
}

.decoration-level label {
    display: block;
    margin-bottom: 10px;
    color: #666;
    font-size: 0.95em;
    font-weight: 500;
}

.decoration-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.decoration-buttons button {
    padding: 8px 15px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.decoration-buttons button:hover {
    background: #e8f5e9;
    border-color: var(--theme-secondary);
}

.decoration-buttons button.active {
    background: var(--theme-secondary);
    color: white;
    border-color: var(--theme-secondary);
}

/* ===================================
   5. THEMED PREVIEW AREA
   =================================== */

.themed-preview {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 30px;
    min-height: 200px;
}

/* Subtle decorative elements based on decoration level */
.decoration-minimal .themed-preview {
    background: white;
}

.decoration-normal .themed-preview {
    background:
        linear-gradient(to bottom,
            rgba(var(--theme-accent-rgb), 0.02) 0%,
            white 20%,
            white 80%,
            rgba(var(--theme-accent-rgb), 0.02) 100%);
}

.decoration-festive .themed-preview {
    background:
        linear-gradient(to bottom,
            rgba(var(--theme-accent-rgb), 0.05) 0%,
            white 15%,
            white 85%,
            rgba(var(--theme-accent-rgb), 0.05) 100%);
}

/* ===================================
   6. CHRISTMAS THEME DECORATIONS
   =================================== */

.theme-christmas.decoration-normal .themed-preview::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="40">❄️</text></svg>') no-repeat;
    opacity: 0.1;
    pointer-events: none;
}

.theme-christmas.decoration-festive .themed-preview::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="40">🎄</text></svg>') no-repeat;
    opacity: 0.15;
    pointer-events: none;
}

/* ===================================
   7. NEW YEAR THEME DECORATIONS
   =================================== */

.theme-newYear.decoration-normal .themed-preview {
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(192, 192, 192, 0.05) 0%, transparent 50%);
}

.theme-newYear.decoration-festive .themed-preview::before {
    content: '2025';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.8em;
    color: rgba(255, 215, 0, 0.2);
    font-weight: bold;
    pointer-events: none;
}

/* ===================================
   8. THEMED FORM ELEMENTS
   =================================== */

.themed-page .form-group input:focus {
    border-color: var(--theme-secondary);
    box-shadow: 0 0 0 3px rgba(var(--theme-secondary-rgb), 0.1);
}

.themed-page .btn {
    background: var(--theme-secondary);
    position: relative;
    overflow: hidden;
}

.themed-page .btn:hover {
    background: var(--theme-primary);
}

/* Themed button with subtle animation */
.theme-christmas .btn::before {
    content: '🎅';
    position: absolute;
    top: -20px;
    right: 10px;
    font-size: 1.5em;
    opacity: 0;
    transition: all 0.3s ease;
}

.theme-christmas .btn:hover::before {
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.2;
}

.theme-newYear .btn {
    background: linear-gradient(135deg, #FFD700 0%, #B8860B 100%);
}

/* ===================================
   9. NAVIGATION ELEMENTS
   =================================== */

.theme-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95em;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-nav-link .icon {
    font-size: 1.2em;
}

.theme-nav-link .badge {
    background: var(--theme-accent);
    color: var(--theme-primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
    margin-left: 5px;
}

/* ===================================
   10. RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .theme-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .decoration-buttons {
        grid-template-columns: 1fr;
    }

    .theme-selector-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* ===================================
   11. ANIMATIONS
   =================================== */

@keyframes sparkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Apply animations to festive decorations */
.decoration-festive .theme-christmas::before,
.decoration-festive .theme-christmas::after {
    animation: float 4s ease-in-out infinite;
}

.decoration-festive .theme-newYear::before {
    animation: sparkle 2s ease-in-out infinite;
}

/* ===================================
   12. PRINT STYLES
   =================================== */

@media print {
    .theme-selector,
    .theme-nav-link {
        display: none;
    }

    .themed-preview {
        background: white !important;
    }

    .themed-preview::before,
    .themed-preview::after {
        display: none;
    }
}