/* Variables - Thème Harry Potter / Poudlard */
:root {
    /* Couleurs principales Poudlard */
    --gryffindor-red: #740001;
    --gryffindor-gold: #D3A625;
    --slytherin-green: #1A472A;
    --slytherin-silver: #5D5D5D;
    --ravenclaw-blue: #0E1A40;
    --ravenclaw-bronze: #946B2D;
    --hufflepuff-yellow: #FFD800;

    /* Couleurs primaires du thème */
    --primary: #AE0001;
    --primary-dark: #740001;
    --secondary: #D3A625;
    --accent: #946B2D;
    --success: #1A472A;
    --danger: #8B0000;

    /* Tons neutres */
    --parchment: #F4ECD8;
    --parchment-dark: #E8DCC0;
    --castle-stone: #2C2C2C;
    --gray-50: #FAF9F6;
    --gray-100: #F4ECD8;
    --gray-200: #E8DCC0;
    --gray-300: #D4C5A9;
    --gray-600: #5D5D5D;
    --gray-700: #3C3C3C;
    --gray-800: #2C2C2C;
    --gray-900: #1A1A1A;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--ravenclaw-blue) 50%, var(--slytherin-green) 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    color: var(--gray-900);
    position: relative;
}

/* Effet parchemin subtil sur le fond */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(244, 236, 216, 0.03) 2px,
            rgba(244, 236, 216, 0.03) 4px
        );
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    background: linear-gradient(to bottom, var(--parchment) 0%, var(--parchment-dark) 100%);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 20px rgba(211, 166, 37, 0.2);
    margin-bottom: 2rem;
    text-align: center;
    border: 2px solid var(--secondary);
    position: relative;
}

header::before {
    content: '✨';
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    opacity: 0.6;
}

header::after {
    content: '✨';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.6;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Emoji chaussette - garder les couleurs naturelles */
.emoji-sock {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: initial;
    background-clip: unset;
    text-shadow: none;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.subtitle {
    color: var(--primary-dark);
    font-size: 1.1rem;
    font-weight: 600;
}

.tagline {
    color: var(--accent);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--parchment);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-align: center;
    border: 1px solid var(--secondary);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--gryffindor-red) 0%,
        var(--gryffindor-gold) 25%,
        var(--ravenclaw-blue) 50%,
        var(--slytherin-green) 75%,
        var(--hufflepuff-yellow) 100%
    );
}

.stat-card:nth-child(1) .stat-value { color: var(--gryffindor-red); }
.stat-card:nth-child(2) .stat-value { color: var(--ravenclaw-blue); }
.stat-card:nth-child(3) .stat-value { color: var(--slytherin-green); }
.stat-card:nth-child(4) .stat-value { color: var(--gryffindor-gold); }

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Tabs Navigation */
.tabs-container {
    background: var(--parchment);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    margin-bottom: 2rem;
    border: 1px solid var(--secondary);
}

.tabs-wrapper {
    margin-bottom: 1rem;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    background: var(--gray-50);
    border: 2px solid var(--accent);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab:hover {
    border-color: var(--secondary);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(174, 0, 1, 0.3);
}

.tab-count {
    font-size: 0.875rem;
    opacity: 0.8;
}

.tab.active .tab-count {
    opacity: 1;
    font-weight: bold;
}

/* Status Toggle */
.status-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.status-btn {
    padding: 0.5rem 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-700);
}

.status-btn:hover {
    border-color: var(--accent);
    background: white;
}

.status-btn.active {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* Ideas List */
.ideas-container {
    background: var(--parchment);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid var(--secondary);
}

.idea-card {
    background: var(--gray-50);
    border-left: 4px solid var(--primary);
    border: 1px solid var(--parchment-dark);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.idea-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(174, 0, 1, 0.2);
    border-left-color: var(--secondary);
}

.idea-card.done {
    opacity: 0.7;
    border-left-color: var(--success);
    background: var(--parchment-dark);
}

.idea-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.idea-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--secondary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.idea-date {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.idea-content {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.idea-content.done {
    text-decoration: line-through;
}

.idea-image {
    margin: 1rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s;
}

.idea-image:hover {
    box-shadow: 0 4px 16px rgba(174, 0, 1, 0.3);
    transform: scale(1.02);
}

.idea-image img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.idea-actions {
    display: flex;
    gap: 0.75rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-done {
    background: linear-gradient(135deg, var(--success) 0%, #0d3319 100%);
    color: white;
    border: 1px solid var(--secondary);
}

.btn-done:hover {
    background: linear-gradient(135deg, #0d3319 0%, var(--success) 100%);
    transform: scale(1.05);
}

.btn-undone {
    background: linear-gradient(135deg, var(--gray-300) 0%, var(--gray-400) 100%);
    color: var(--gray-800);
    border: 1px solid var(--accent);
}

.btn-undone:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    color: white;
    transform: scale(1.05);
}

.idea-id {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-family: monospace;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-600);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Loading */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .tabs-container {
        padding: 1rem;
    }

    .tabs {
        gap: 0.375rem;
    }

    .tab {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .tab-count {
        font-size: 0.75rem;
    }

    .status-toggle {
        flex-direction: row;
    }

    .status-btn {
        flex: 1;
    }

    .idea-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}
