@import url("https://fonts.googleapis.com/css2?family=Futura:wght@400;500;700&family=Courier+Prime:wght@400;700&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Futura", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f4e6d1 0%, #e8d5b7 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #5d4037;
}

/* Utility classes */
.honeypot {
    display: none;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: bold;
}

.font-large {
    font-size: 1.5em;
}

.font-huge {
    font-size: 5em;
}

.font-xlarge {
    font-size: 2em;
}

.font-small {
    font-size: small;
}

.font-xsmall {
    font-size: x-small;
}

/* Consistent spacing */
.margin-std {
    margin: 30px 0;
}

.margin-bottom-std {
    margin-bottom: 30px;
}

.margin-bottom-sm {
    margin-bottom: 10px;
}

.margin-bottom-md {
    margin-bottom: 15px;
}

.margin-top-sm {
    margin-top: 5px;
}

.margin-top-md {
    margin-top: 10px;
}

.margin-top-lg {
    margin-top: 20px;
}

.padding-std {
    padding: 20px;
}

.padding-sm {
    padding: 15px;
}

.gap-std {
    gap: 20px;
}

/* Consistent colors */
.color-primary {
    color: #333;
}

.color-secondary {
    color: #666;
}

.color-muted {
    color: #7f8c8d;
}

.color-dark {
    color: #2c3e50;
}

.color-danger {
    color: #922b21;
}

.skalk-color {
    color: #27ae60;
}

.ikke-skalk-color {
    color: #e74c3c;
}

/* Consistent backgrounds */
.bg-white {
    background: white;
}

.bg-light {
    background: #f9f9f9;
}

/* Consistent borders and shadows */
.border-radius-std {
    border-radius: 8px;
}

.shadow-light {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shadow-medium {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Container and layout utilities */
.container-wide {
    max-width: 1200px;
    margin: 0 auto;
}

.container-chart {
    max-width: 800px;
    margin: 0 auto;
    min-height: 400px;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

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

/* Mobile-specific utilities */
.mobile-full-width {
    width: 100%;
}

.mobile-flex-row {
    display: flex;
    flex-direction: row;
}

.mobile-flex-1 {
    flex: 1;
}

.mobile-text-large {
    font-size: 1.2rem;
}

.mobile-padding-sm {
    padding: 0.5rem;
}

.mobile-margin-sm {
    margin: 0.5rem;
}

/* Header styling */
header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    border-bottom: 4px solid #d32f2f;
    border-radius: 2px;
}

h1 {
    font-family: "Courier Prime", monospace;
    font-size: 2.2rem;
    font-weight: 700;
    color: #3e2723;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 0px #f5f5dc;
    margin-bottom: 0.5rem;
}

/* Main content container */
main {
    background: #fff8e1;
    border: 4px solid #8d6e63;
    border-radius: 0;
    padding: 2.5rem;
    max-width: 750px;
    width: 100%;
    box-shadow:
        0 0 0 2px #d7ccc8,
        0 0 0 4px #8d6e63,
        8px 8px 0 #5d4037,
        12px 12px 0 #3e2723;
    position: relative;
}

main::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #d32f2f 0%, #ff6b35 50%, #f9ca24 100%);
    z-index: -1;
    border-radius: 4px;
}

.fade-container {
    transition: opacity 0.4s ease-in-out;
}

.fade-container.htmx-swapping {
    opacity: 0.5;
}

/* Vote box styling */
#vote-box {
    text-align: center;
    background: #ffffff;
    border: 3px solid #795548;
    padding: 2rem;
    margin: 1rem 0;
    position: relative;
}

#vote-box::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid #d7ccc8;
    pointer-events: none;
}

/* Image styling */
#vote-box img {
    width: 600px;
    height: 480px;
    object-fit: cover;
    background-color: #e8d5b7;
    border: 3px solid #6d4c41;
    padding: 10px;
    background: #fafafa;
    margin-bottom: 2rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Form styling */
form {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Button styling */
button {
    font-family: "Futura", sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border: 3px solid #3e2723;
    background: #fff;
    color: #3e2723;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 120px;
}

button#skalkikke {
    background: #ff6b35;
    color: #fff;
    border-color: #e55100;
}

button#skalkikke:hover {
    background: #ff5722;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #d84315;
}

button#skalk {
    background: #4caf50;
    color: #fff;
    border-color: #2e7d32;
}

button#skalk:hover {
    background: #43a047;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #1b5e20;
}

button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #3e2723;
}

button:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 #3e2723;
}

/* Footer styling */
footer {
    margin-top: 3rem;
    text-align: center;
    position: relative;
}

footer::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: #8d6e63;
}

footer a {
    font-family: "Courier Prime", monospace;
    color: #5d4037;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.5rem 1rem;
    border: 2px solid #8d6e63;
    background: #fff8e1;
    transition: all 0.2s ease;
    display: inline-block;
}

footer a:hover {
    background: #f5f5dc;
    color: #3e2723;
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 #5d4037;
}

/* Statistics page styling - consolidated with utility classes */
.chart-container {
    overflow: hidden;
}

.chart-container .item {
    width: 100% !important;
}

.podium {
    margin-bottom: 20px;
}

.podium-place {
    min-width: 180px;
    max-width: 220px;
}

.podium-place.first {
    order: 2;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    transform: scale(1.1);
}

.podium-place.second {
    order: 1;
    background: linear-gradient(135deg, #c0c0c0, #e6e6e6);
}

.podium-place.third {
    order: 3;
    background: linear-gradient(135deg, #cd7f32, #daa520);
}

.podium-rank.first {
    color: #b8860b;
}

.podium-rank.second {
    color: #708090;
}

.podium-rank.third {
    color: #8b4513;
}

.podium-image {
    font-size: 1.2em;
}

.podium-stats {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.podium-image-display {
    margin: 10px 0;
    overflow: hidden;
}

.podium-image-display img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    /* Minimize body padding for more screen space */
    body {
        padding: 0.5rem;
        justify-content: flex-start;
        min-height: 100vh;
        /* Disable text selection for better touch experience */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    /* Compact header */
    header {
        margin-bottom: 0.5rem;
        border-bottom: 3px solid #d32f2f;
    }

    h1 {
        font-size: 2rem;
        letter-spacing: 1px;
        margin: 0.6rem 0;
    }

    /* Minimal main container styling */
    main {
        padding: 0.25rem;
        max-width: 100%;
        /* Simplified box shadow for mobile */
        box-shadow:
            0 0 0 1px #d7ccc8,
            0 0 0 2px #8d6e63,
            2px 2px 0 #5d4037;
        margin: 1rem 0;
    }

    /* Minimal border effect */
    main::before {
        top: -1px;
        left: -1px;
        right: -1px;
        bottom: -1px;
        border-radius: 2px;
    }

    /* Vote box takes full width */
    #vote-box {
        padding: 0.6rem;
        margin: 0;
        border: 2px solid #795548;
    }

    #vote-box::before {
        top: 5px;
        left: 5px;
        right: 5px;
        bottom: 5px;
    }

    /* Image takes nearly full width */
    #vote-box img {
        width: 100%;
        height: auto;
        max-height: 60vh;
        min-height: 350px;
        object-fit: cover;
        border: 2px solid #6d4c41;
        padding: 5px;
        margin-bottom: 1rem;
    }

    /* Form layout for mobile */
    form {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    /* Large mobile buttons */
    button {
        font-size: 1.4rem;
        font-weight: 600;
        padding: 1.4rem 0.5rem;
        flex: 1;
        min-width: 0;
        border: 2px solid #3e2723;
        text-align: center;
        line-height: 1.2;
        /* Touch-friendly enhancements */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    button#skalkikke:hover {
        transform: translate(-1px, -1px);
        box-shadow: 2px 2px 0 #d84315;
    }

    button#skalk:hover {
        transform: translate(-1px, -1px);
        box-shadow: 2px 2px 0 #1b5e20;
    }

    button:hover {
        transform: translate(-1px, -1px);
        box-shadow: 2px 2px 0 #3e2723;
    }

    button:active {
        transform: translate(0, 0);
        box-shadow: 1px 1px 0 #3e2723;
    }

    /* Compact footer */
    footer {
        margin-top: 1rem;
        /* Allow text selection for footer links */
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }

    footer::before {
        top: -10px;
        width: 30px;
        height: 1px;
    }

    footer a {
        font-size: 1.2rem;
        padding: 0.4rem 0.8rem;
        letter-spacing: 1px;
        border: 1px solid #8d6e63;
        /* Touch-friendly footer links */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    footer a:hover {
        transform: translate(-0.5px, -0.5px);
        box-shadow: 1px 1px 0 #5d4037;
    }

    /* Mobile statistics page adjustments */
    .stats-container {
        padding: 0.5rem;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .stat-box {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5em;
    }

    .font-huge {
        font-size: 3em;
    }

    .font-xlarge {
        font-size: 1.5em;
    }

    .chart-container {
        margin: 1rem 0;
        padding: 1rem;
    }

    .chart-title {
        font-size: 1.2em;
        margin-bottom: 0.5rem;
    }

    .podium-container {
        margin: 1rem 0;
        padding: 1rem;
    }

    .podium-title {
        font-size: 1.2em;
        margin-bottom: 0.5rem;
    }

    .podium {
        flex-direction: column;
        gap: 1rem;
        margin: 1rem 0;
    }

    .podium-place {
        min-width: auto;
        max-width: none;
        width: 100%;
        padding: 0.1rem 1rem;
    }

    .podium-place.first {
        order: 1;
        transform: none;
    }

    .podium-place.second {
        order: 2;
    }

    .podium-place.third {
        order: 3;
    }

    .podium-image-display img {
        height: 170px;
    }

    .margin-bottom-sm {
        margin-bottom: 1px;
    }
}
