/* File: assets/css/style.css */
/* Main stylesheet for ScoreMyArt */

/* ----------------------------- */
/* --- Global Styles & Fonts --- */
/* ----------------------------- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #F7F7F7; /* Light Gray Page Background */
    color: #333333; /* Default text color */
}

/* Sticky footer layout: footer at bottom of viewport when content is short */
html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Allow main content to grow and push the footer down */
main {
    flex: 1 0 auto;
}

.impersonation-banner {
    background: #7f1d1d;
    color: #ffffff;
    border-bottom: 3px solid #f59e0b;
}

.impersonation-banner-subtext {
    color: #fde68a;
}

.impersonation-return-button {
    background: #ffffff;
    color: #7f1d1d;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.impersonation-return-button:hover {
    background: #fff7ed;
    color: #991b1b;
}

.filter-control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.filter-control-label {
    flex: 0 0 auto;
}

.segmented-control {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-width: 0;
}

.segmented-control a {
    white-space: nowrap;
}

.artwork-rotate-controls {
    display: block;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 0.5rem;
    color: #1f2937;
}

.artwork-rotate-controls.hidden {
    display: none;
}

.artwork-rotate-title {
    margin: 0 0 0.5rem;
    color: #111827;
    font-size: 0.875rem;
    font-weight: 700;
}

.artwork-rotate-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.artwork-rotate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.75rem;
    background: #374151;
    color: #ffffff;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 700;
}

.artwork-rotate-button:hover {
    background: #1f2937;
}

.artwork-rotate-help {
    margin-top: 0.5rem;
    color: #4b5563;
    font-size: 0.75rem;
}

@media (max-width: 640px) {
    .filter-control-group {
        align-items: flex-start;
        flex-direction: column;
        width: 100%;
    }

    .segmented-control {
        width: 100%;
    }
}

/* -------------------------- */
/* --- Reusable Components -- */
/* -------------------------- */

/* Main content container for forms, etc. */
.content-container {
    width: 100%;
    padding: 2rem; /* 32px */
    background-color: #FFFFFF;
    border-radius: 0.5rem; /* 8px */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.auth-container {
    max-width: 28rem; /* 448px */
}

.artwork-detail-image {
    display: block;
    width: 100%;
    height: 24rem;
    max-height: 70vh;
    object-fit: contain;
    background: #f9fafb;
}

.scoring-container {
    max-width: 96rem;
    padding: 1.25rem;
}

.scoring-page-header {
    margin-bottom: 1.5rem;
}

.scoring-page-header h1 {
    font-size: 1.75rem;
    line-height: 1.15;
}

.scoring-toast {
    position: fixed;
    top: 5.5rem;
    left: 50%;
    z-index: 60;
    width: min(44rem, calc(100vw - 2rem));
    transform: translateX(-50%);
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.scoring-toast.is-hiding {
    opacity: 0;
    transform: translate(-50%, -0.5rem);
}

.scoring-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

.mobile-scoring-sticky-image {
    position: sticky;
    top: 4.75rem;
    z-index: 20;
    background: #FFFFFF;
    padding: 0.4rem 0 0.65rem;
    margin-bottom: 0.75rem;
}

.mobile-scoring-sticky-image img {
    width: 100%;
    max-height: 34vh;
    object-fit: contain;
    background: #f9fafb;
}

.scoring-image-frame {
    display: none;
}

.scoring-artwork-panel,
.scoring-drawer,
.score-card {
    min-width: 0;
}

.score-card {
    width: 100%;
}

.scoring-artwork-details {
    margin-top: 1rem;
}

.scoring-artwork-details h2 {
    font-size: 1.5rem;
    line-height: 1.2;
}

.scoring-meta,
.scoring-description {
    font-size: 0.9375rem;
}

.scoring-description {
    margin-top: 0.75rem;
}

.score-slider {
    height: 2rem;
    touch-action: pan-y;
}

.score-slider::-webkit-slider-runnable-track {
    height: 0.5rem;
    border-radius: 9999px;
    background: #E5E7EB;
}

.score-slider::-webkit-slider-thumb {
    appearance: none;
    width: 2.5rem;
    height: 2.5rem;
    margin-top: -1rem;
    border-radius: 9999px;
    background: #3B82F6;
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.28);
}

.score-slider::-moz-range-track {
    height: 0.5rem;
    border-radius: 9999px;
    background: #E5E7EB;
}

.score-slider::-moz-range-thumb {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: #3B82F6;
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.28);
}

@media (min-width: 640px) {
    .scoring-container {
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .scoring-container {
        padding: 1.5rem 2.5rem 1.5rem;
    }

    .scoring-layout {
        grid-template-columns: minmax(0, 1fr) minmax(26rem, 31rem);
        gap: 2.25rem;
        align-items: start;
    }

    .scoring-page-header {
        margin-bottom: 1rem;
    }

    .scoring-page-header h1 {
        font-size: 1.75rem;
    }

    .mobile-scoring-sticky-image {
        display: none;
    }

    .scoring-image-frame {
        display: block;
        position: relative;
        top: auto;
        z-index: auto;
        padding-bottom: 0;
    }

    #scoringMainImage {
        width: 100%;
        max-height: calc(100vh - 14rem);
        object-fit: contain;
        background: #f9fafb;
    }

    .scoring-artwork-details {
        margin-top: 0.75rem;
    }

    .scoring-artwork-details h2 {
        font-size: 1.25rem;
    }

    .scoring-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 1rem;
    }

    .scoring-description {
        margin-top: 0.5rem;
        max-height: 2.6rem;
        overflow: hidden;
    }

    .scoring-form {
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
    }

    .scoring-form.space-y-6 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0;
    }

    .score-card {
        padding: 0.75rem 1rem;
    }

    .score-card label {
        margin-bottom: 0.25rem;
    }

    .score-card p {
        margin-bottom: 0.35rem;
    }

    .score-card .score-slider {
        margin-bottom: 0.25rem;
    }

    .score-card .flex {
        margin-bottom: 0.25rem;
    }

    .score-card [id$="_description"] {
        font-size: 0.875rem;
        line-height: 1.35;
    }

    #comment {
        min-height: 3.5rem;
    }
}

@media (min-width: 1024px) and (max-height: 850px) {
    main {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .scoring-container {
        padding: 1.15rem 2.15rem 1.15rem;
    }

    .scoring-page-header {
        margin-bottom: 0.8rem;
    }

    .scoring-page-header h1 {
        font-size: 1.55rem;
    }

    .scoring-layout {
        gap: 1.75rem;
    }

    #scoringMainImage {
        max-height: calc(100vh - 13rem);
    }

    .scoring-artwork-details {
        margin-top: 0.5rem;
    }

    .scoring-artwork-details h2 {
        font-size: 1.125rem;
    }

    .scoring-meta,
    .scoring-description {
        font-size: 0.875rem;
        line-height: 1.3;
    }

    .scoring-description {
        max-height: 1.2rem;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .scoring-form {
        gap: 0.5rem;
    }

    .score-card {
        padding: 0.6rem 0.9rem;
    }

    .score-card label {
        font-size: 0.875rem;
        line-height: 1.2;
    }

    .score-card p,
    .score-card [id$="_description"] {
        font-size: 0.75rem;
        line-height: 1.25;
    }

    .score-slider {
        height: 1.75rem;
    }

    #comment {
        min-height: 3rem;
    }
}

@media (min-width: 1280px) {
    .scoring-layout {
        grid-template-columns: minmax(0, 1fr) minmax(28rem, 32rem);
        gap: 2.75rem;
    }
}

/* Primary Call-to-Action Button */
.btn-primary {
    display: inline-block;
    width: 100%;
    text-align: center;
    background-color: #F58634; /* Brand Orange */
    color: #FFFFFF;
    font-weight: bold;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem; /* 8px */
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #E47521; /* Slightly darker orange */
}

/* Secondary Button */
.btn-secondary {
    display: inline-block;
    width: 100%;
    text-align: center;
    background-color: #6B7280; /* Gray */
    color: #FFFFFF;
    font-weight: bold;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem; /* 8px */
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #4B5563; /* Slightly darker gray */
}

/* Form Input Fields */
.form-input {
    margin-top: 0.25rem;
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: #FFFFFF;
    border: 1px solid #DDDDDD;
    border-radius: 0.375rem; /* 6px */
    box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.05);
}

.form-input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #F58634;
    box-shadow: 0 0 0 2px #F58634;
}

/* -------------------------- */
/* --- Modal & Critique Styles -- */
/* -------------------------- */

/* Blur effect for flagged comments */
.blur-sm {
    filter: blur(4px);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Critique card hover effects */
.critique-card {
    transition: all 0.2s ease-in-out;
}

.critique-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Flagged comment styling */
.flagged-comment {
    border: 2px solid #FEE2E2;
    background-color: #FEF2F2;
}

.flagged-comment .blur-overlay {
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.9), rgba(254, 242, 242, 0.9));
}
