/* CSS Variables for Theme Support */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-secondary: #4a4a4a;
    --border-color: #e0e0e0;
    --vote-button-bg: #1a1a1a;
    --vote-button-text: #ffffff;
    --vote-button-hover: #333333;
    --vote-button-active: #000000;
    --item-bg: #fafafa;
    --item-border: #e8e8e8;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0a0a0a;
        --text-color: #f5f5f5;
        --text-secondary: #b0b0b0;
        --border-color: #2a2a2a;
        --vote-button-bg: #f5f5f5;
        --vote-button-text: #0a0a0a;
        --vote-button-hover: #e0e0e0;
        --vote-button-active: #ffffff;
        --item-bg: #141414;
        --item-border: #2a2a2a;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Flag Header */
.flag-header {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    padding-top: 1rem;
}

.flag-icon {
    width: 60px;
    height: auto;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.flag-icon:hover {
    opacity: 0.6;
}

/* Typography */
.intro {
    margin-bottom: 4rem;
}

.intro-text {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(0.9rem, 2.4vw, 1.35rem);
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-weight: 400;
}

.intro-text strong {
    font-weight: 700;
    font-style: italic;
}

/* Manifesto Points Section */
.manifesto-points {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.manifesto-item {
    background-color: var(--item-bg);
    border: none;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.manifesto-item.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.item-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.item-number {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(2.25rem, 4.5vw, 3.75rem);
    font-weight: 700;
    line-height: 1;
    color: var(--text-color);
    flex-shrink: 0;
    margin: 0;
}

.item-text {
    flex: 1;
}

.item-title {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(1.05rem, 2.4vw, 1.5rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.item-description {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(0.75rem, 1.875vw, 0.84375rem);
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-secondary);
}

.item-description ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.item-description li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.item-description li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-color);
    font-weight: 400;
}

.item-description p {
    margin-bottom: 1rem;
    font-weight: 400;
}

/* Vote Controls */
.vote-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: none;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.manifesto-item:hover .vote-controls {
    opacity: 1;
}

.vote-button {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.65625rem;
    font-weight: 400;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    user-select: none;
}

.vote-button:hover {
    color: var(--text-color);
    border-color: var(--text-color);
    background-color: var(--item-bg);
}

.vote-button:active {
    transform: scale(0.98);
}

.vote-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.vote-button.voted {
    opacity: 0.5;
    cursor: default;
}

.vote-icon {
    font-size: 0.65625rem;
    line-height: 1;
}

.vote-text {
    font-size: 0.65625rem;
}

.vote-count {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.65625rem;
    font-weight: 400;
    color: var(--text-secondary);
    min-width: 2ch;
    text-align: center;
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: none;
}

.footer-text {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(0.9375rem, 2.25vw, 1.3125rem);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.footer-text strong {
    font-weight: 700;
    font-style: italic;
}

.share-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: none;
    display: flex;
    justify-content: center;
}

.share-button {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.65625rem;
    font-weight: 400;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    user-select: none;
}

.share-button:hover {
    color: var(--text-color);
    border-color: var(--text-color);
    background-color: var(--item-bg);
}

.share-button:active {
    transform: scale(0.98);
}

.share-icon {
    font-size: 0.65625rem;
    line-height: 1;
}

.share-text {
    font-size: 0.65625rem;
}

/* Responsive Design */
@media (min-width: 768px) {
    main {
        padding: 3rem 2rem;
    }

    .intro {
        margin-bottom: 5rem;
    }

    .manifesto-item {
        flex-direction: row;
        align-items: flex-start;
        padding: 2.5rem;
    }

    .item-content {
        flex: 1;
    }

    .vote-controls {
        flex-direction: column;
        align-items: flex-end;
        padding-top: 0;
        border-top: none;
        border-left: none;
        padding-left: 1rem;
        min-width: 80px;
    }

    .vote-button {
        width: auto;
        justify-content: center;
    }
}

@media (min-width: 1024px) {
    main {
        padding: 4rem 2.5rem;
    }

    .intro-text {
        font-size: 1.5rem;
    }

    .item-title {
        font-size: 1.65rem;
    }
}

/* Animation for reordering */
.manifesto-item {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s ease,
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.manifesto-item.reordering {
    opacity: 0.7;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.vote-button:focus-visible {
    outline: 3px solid var(--text-color);
    outline-offset: 2px;
}

