/* ======================================================
   doublestandard.xyz - Neomorphism Soft UI
   Palette:
     Cloud Base:   #e8e8ee
     Shadow Dark:  #c8c8d0
     Shadow Light: #ffffff
     Text Dark:    #2d3436
     Calm Blue:    #74b9ff
     Soft Coral:   #fab1a0
     Soft Mint:    #a4e0c8
   ====================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    color: #2d3436;
    background-color: #e8e8ee;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- App Container --- */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* --- Header --- */
.app-header {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}

.app-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #2d3436;
    letter-spacing: -0.02em;
}

.title-accent {
    color: #74b9ff;
}

.app-subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #2d3436;
    opacity: 0.65;
    margin-top: 0.25rem;
}

/* --- Neumorphic Primitives --- */
.neu-card {
    background: #e8e8ee;
    border-radius: 16px;
    box-shadow: 8px 8px 16px #c8c8d0, -8px -8px 16px #ffffff;
    transition: box-shadow 0.15s ease;
}

.neu-card:active {
    box-shadow: inset 8px 8px 16px #c8c8d0, inset -8px -8px 16px #ffffff;
}

.neu-input {
    background: #e8e8ee;
    border: none;
    border-radius: 12px;
    box-shadow: inset 4px 4px 8px #c8c8d0, inset -4px -4px 8px #ffffff;
    padding: 0.75rem 1rem;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    color: #2d3436;
    width: 100%;
    outline: none;
    transition: box-shadow 0.2s ease;
}

.neu-input::placeholder {
    color: #2d3436;
    opacity: 0.35;
}

.neu-input:focus {
    box-shadow: inset 2px 2px 4px #c8c8d0, inset -2px -2px 4px #ffffff, 0 0 0 3px rgba(116, 185, 255, 0.3);
}

.neu-textarea {
    resize: vertical;
    min-height: 60px;
}

.neu-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%232d3436' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.neu-button {
    background: #e8e8ee;
    border: none;
    border-radius: 12px;
    box-shadow: 6px 6px 12px #c8c8d0, -6px -6px 12px #ffffff;
    padding: 0.7rem 1.5rem;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2d3436;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.neu-button:active {
    box-shadow: inset 6px 6px 12px #c8c8d0, inset -6px -6px 12px #ffffff;
    transform: scale(0.98);
}

.neu-button:hover .pulse-ring {
    animation: pulse-ring 0.6s ease-out;
}

/* Pulse Ring Animation */
.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid #74b9ff;
    border-radius: 12px;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    pointer-events: none;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* --- Scale Section --- */
.scale-section {
    padding: 2rem 0 1rem;
}

.scale-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    width: 320px;
    margin-bottom: 0.75rem;
}

.scale-label {
    font-family: 'Zilla Slab', serif;
    font-weight: 600;
    font-size: 1.1rem;
}

.scale-label-praised {
    color: #a4e0c8;
}

.scale-label-condemned {
    color: #fab1a0;
}

.scale {
    position: relative;
    width: 320px;
    height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Beam */
.scale-beam {
    position: absolute;
    top: 60px;
    left: 50%;
    width: 300px;
    height: 4px;
    background: #2d3436;
    border-radius: 2px;
    transform-origin: center center;
    transform: translateX(-50%) rotate(0deg);
    transition: transform 0.5s ease-in-out;
    z-index: 2;
}

/* Chains */
.scale-chain {
    position: absolute;
    top: 4px;
    width: 2px;
    height: 50px;
    background: #2d3436;
    opacity: 0.5;
}

.scale-chain-left {
    left: 20px;
}

.scale-chain-right {
    right: 20px;
}

/* Platforms */
.scale-platform {
    position: absolute;
    top: 54px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #e8e8ee;
    box-shadow: 6px 6px 12px #c8c8d0, -6px -6px 12px #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease-in-out;
    z-index: 3;
}

.scale-platform-left {
    left: -30px;
}

.scale-platform-right {
    right: -30px;
}

.platform-content {
    text-align: center;
    padding: 0.5rem;
    overflow: hidden;
}

.platform-placeholder {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.7rem;
    color: #2d3436;
    opacity: 0.4;
}

.platform-text {
    font-family: 'Zilla Slab', serif;
    font-weight: 600;
    font-size: 0.75rem;
    color: #2d3436;
    word-break: break-word;
}

/* Fulcrum */
.scale-fulcrum {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 40px solid #2d3436;
    opacity: 0.85;
    z-index: 1;
}

/* Base */
.scale-base {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 8px;
    background: #2d3436;
    border-radius: 4px;
    opacity: 0.6;
}

/* --- Section Titles --- */
.section-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: #2d3436;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* --- Submission Section --- */
.submission-section {
    padding: 2rem 0;
}

.submission-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group-context {
    max-width: 100%;
}

.form-group-category {
    max-width: 220px;
    align-self: center;
}

.form-label {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #2d3436;
    opacity: 0.7;
}

.form-hint {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
}

.praised-hint {
    color: #a4e0c8;
}

.condemned-hint {
    color: #fab1a0;
}

.form-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 1.6rem;
    gap: 0.15rem;
    flex-shrink: 0;
}

.arrow-reverse {
    transform: scaleX(-1);
}

.submit-button {
    align-self: center;
    padding: 0.85rem 2.5rem;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    color: #74b9ff;
    margin-top: 0.5rem;
}

/* --- Featured Section --- */
.featured-section {
    padding: 2rem 0;
}

.featured-card {
    padding: 1.75rem;
}

.featured-sides {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.featured-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    gap: 0.5rem;
}

.praised-side {
    border-radius: 12px 0 0 12px;
}

.condemned-side {
    border-radius: 0 12px 12px 0;
}

.side-badge {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
}

.praised-badge {
    background: rgba(164, 224, 200, 0.25);
    color: #6bb89a;
}

.condemned-badge {
    background: rgba(250, 177, 160, 0.25);
    color: #e07a6a;
}

.featured-text {
    font-family: 'Zilla Slab', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #2d3436;
    text-align: center;
}

.featured-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
}

.vs-label {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    color: #2d3436;
    opacity: 0.35;
    text-transform: lowercase;
}

.featured-context {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.85rem;
    color: #2d3436;
    opacity: 0.55;
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(200, 200, 208, 0.4);
}

.featured-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.vote-button {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    border-radius: 20px;
    color: #2d3436;
    opacity: 0.7;
    transition: box-shadow 0.15s ease, color 0.2s ease, opacity 0.2s ease;
}

.vote-button:hover {
    opacity: 1;
}

.vote-button.voted {
    box-shadow: inset 4px 4px 8px #c8c8d0, inset -4px -4px 8px #ffffff;
    color: #74b9ff;
    opacity: 1;
}

.vote-count {
    font-weight: 700;
    color: #74b9ff;
}

.equality-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #74b9ff;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 6px #c8c8d0, -3px -3px 6px #ffffff;
}

.equality-badge.resolved {
    display: flex;
}

/* --- Browse / Filter --- */
.browse-section {
    padding: 2rem 0;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    border-radius: 20px;
    transition: box-shadow 0.15s ease, color 0.2s ease;
}

.filter-btn.active {
    box-shadow: inset 4px 4px 8px #c8c8d0, inset -4px -4px 8px #ffffff;
    color: #74b9ff;
}

/* --- Masonry Grid --- */
.masonry-grid {
    columns: 2;
    column-gap: 1.25rem;
}

.masonry-card {
    break-inside: avoid;
    margin-bottom: 1.25rem;
    background: #e8e8ee;
    border-radius: 16px;
    box-shadow: 8px 8px 16px #c8c8d0, -8px -8px 16px #ffffff;
    padding: 1.25rem;
    transition: box-shadow 0.15s ease;
    cursor: pointer;
}

.masonry-card:active {
    box-shadow: inset 8px 8px 16px #c8c8d0, inset -8px -8px 16px #ffffff;
}

.masonry-card:hover {
    box-shadow: 10px 10px 20px #c8c8d0, -10px -10px 20px #ffffff;
}

.card-pair {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-side {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.card-side-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.indicator-praised {
    background: #a4e0c8;
}

.indicator-condemned {
    background: #fab1a0;
}

.card-side-text {
    font-family: 'Zilla Slab', serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3436;
    line-height: 1.4;
}

.card-connector {
    text-align: center;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.7rem;
    color: #2d3436;
    opacity: 0.3;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.card-context {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.78rem;
    color: #2d3436;
    opacity: 0.5;
    margin-top: 0.6rem;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(200, 200, 208, 0.3);
}

.card-votes {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.75rem;
    color: #2d3436;
    opacity: 0.45;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.card-votes:hover {
    opacity: 0.8;
}

.card-votes.voted {
    color: #74b9ff;
    opacity: 0.9;
}

.card-votes strong {
    color: #74b9ff;
    opacity: 1;
    font-weight: 600;
}

.card-tag {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.65rem;
    color: #74b9ff;
    background: rgba(116, 185, 255, 0.12);
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
    text-transform: capitalize;
}

.card-resolved {
    position: relative;
}

.card-resolved::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #74b9ff;
    box-shadow: 2px 2px 4px #c8c8d0, -2px -2px 4px #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8l3.5 3.5L13 5' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #e8e8ee;
    border-radius: 12px;
    box-shadow: 8px 8px 16px #c8c8d0, -8px -8px 16px #ffffff;
    padding: 0.85rem 1.5rem;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #74b9ff;
    z-index: 100;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- Footer --- */
.app-footer {
    padding: 3rem 0 1rem;
    text-align: center;
}

.footer-text {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.8rem;
    color: #2d3436;
    opacity: 0.4;
}

/* --- Animations --- */
@keyframes card-appear {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.masonry-card {
    animation: card-appear 0.4s ease-out both;
}

@keyframes scale-tilt {
    0% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(-8deg); }
    50% { transform: translateX(-50%) rotate(5deg); }
    75% { transform: translateX(-50%) rotate(-3deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

.scale-beam.animating {
    animation: scale-tilt 1.2s ease-in-out;
}

@keyframes tilt-left {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(-12deg); }
}

@keyframes tilt-right {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(12deg); }
}

/* Platform vertical shift when beam tilts */
.scale-beam.tilt-left {
    transform: translateX(-50%) rotate(-12deg);
}

.scale-beam.tilt-right {
    transform: translateX(-50%) rotate(12deg);
}

.scale-beam.tilt-balanced {
    transform: translateX(-50%) rotate(0deg);
}

/* Submission success flash */
@keyframes success-flash {
    0% { box-shadow: 6px 6px 12px #c8c8d0, -6px -6px 12px #ffffff; }
    50% { box-shadow: 0 0 0 4px rgba(164, 224, 200, 0.4), 6px 6px 12px #c8c8d0, -6px -6px 12px #ffffff; }
    100% { box-shadow: 6px 6px 12px #c8c8d0, -6px -6px 12px #ffffff; }
}

.submit-button.success {
    animation: success-flash 0.6s ease;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .app-container {
        padding: 1.25rem 1rem 2rem;
    }

    .scale {
        transform: scale(0.6);
        transform-origin: top center;
        height: 180px;
    }

    .scale-labels {
        width: 200px;
    }

    /* Reduced neumorphic shadows on mobile */
    .neu-card,
    .masonry-card {
        box-shadow: 4px 4px 8px #c8c8d0, -4px -4px 8px #ffffff;
    }

    .neu-card:active,
    .masonry-card:active {
        box-shadow: inset 4px 4px 8px #c8c8d0, inset -4px -4px 8px #ffffff;
    }

    .scale-platform {
        box-shadow: 3px 3px 6px #c8c8d0, -3px -3px 6px #ffffff;
    }

    .neu-button {
        box-shadow: 3px 3px 6px #c8c8d0, -3px -3px 6px #ffffff;
    }

    .neu-button:active {
        box-shadow: inset 3px 3px 6px #c8c8d0, inset -3px -3px 6px #ffffff;
    }

    .form-row {
        flex-direction: column;
    }

    .form-arrow {
        flex-direction: row;
        padding-top: 0;
        gap: 0.5rem;
    }

    .arrow-reverse {
        transform: scaleX(-1) rotate(90deg);
    }

    .form-arrow svg:first-child {
        transform: rotate(90deg);
    }

    .masonry-grid {
        columns: 1;
    }

    .featured-sides {
        flex-direction: column;
    }

    .featured-divider {
        padding: 0.25rem 0;
    }

    .praised-side {
        border-radius: 12px 12px 0 0;
    }

    .condemned-side {
        border-radius: 0 0 12px 12px;
    }

    .filter-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }

    .form-group-category {
        align-self: stretch;
        max-width: 100%;
    }
}
