/* ============================================
   KHMINDS Vote - Clean Professional Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Light Theme Variables */
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --bg-subtle: #fafafa;
    --bg-input: #ffffff;
    --bg-hover: #f5f5f5;

    --text-main: #1a1a1a;
    --text-muted: #666666;
    --text-light: #999999;

    --border-color: #e5e5e5;
    --border-focus: #1a1a1a;

    --accent: #1a1a1a;
    --accent-text: #ffffff;

    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-toast: 0 8px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-body: #111111;
    --bg-card: #1a1a1a;
    --bg-subtle: #161616;
    --bg-input: #222222;
    --bg-hover: #2a2a2a;

    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --text-light: #71717a;

    --border-color: #333333;
    --border-focus: #ffffff;

    --accent: #ffffff;
    --accent-text: #000000;

    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-toast: 0 8px 30px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

.layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 80px;
    padding: 80px 0;
    min-height: 100vh;
    align-items: start;
}

/* Left Column */
.left-col {
    position: sticky;
    top: 24px;
    height: fit-content;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding-right: 4px;

    /* Hide scrollbar but allow scrolling */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.left-col::-webkit-scrollbar {
    display: none;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.logo {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

/* Custom Theme Toggle */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.theme-switch {
    display: inline-block;
    height: 28px;
    position: relative;
    width: 52px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #e5e5e5;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: #fff;
    bottom: 3px;
    content: "";
    height: 22px;
    left: 3px;
    position: absolute;
    transition: .4s;
    width: 22px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dark mode state */
[data-theme="dark"] .slider {
    background-color: #333;
}

[data-theme="dark"] .slider:before {
    transform: translateX(24px);
    background-color: #fff;
}

/* Icon inside slider */
.slider-icon {
    position: absolute;
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .4s;
    z-index: 1;
    pointer-events: none;
}

[data-theme="dark"] .slider-icon {
    transform: translate(24px, -50%);
}

.slider-icon svg {
    width: 14px;
    height: 14px;
    color: #333;
}

.tagline {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* Form */
.form-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: background-color 0.3s, border-color 0.3s;
}

.form-heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-main);
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(125, 125, 125, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

/* Radio Group for Category */
.radio-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.radio-label {
    position: relative;
    cursor: pointer;
}

.radio-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
    text-align: center;
}

.radio-input:checked+.radio-tile {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.radio-label:hover .radio-tile {
    border-color: var(--text-light);
}

.radio-input:focus+.radio-tile {
    box-shadow: 0 0 0 3px rgba(125, 125, 125, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-text);
    background: var(--accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-submit:hover {
    opacity: 0.9;
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit svg {
    width: 18px;
    height: 18px;
}

/* Sync Status */
.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-light);
}

.sync-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Right Column */
.right-col {
    min-width: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters */
.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--text-light);
    color: var(--text-main);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
}

/* Suggestion List */
.suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Suggestion Card */
.suggestion {
    display: flex;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.suggestion:hover {
    border-color: var(--text-light);
    box-shadow: var(--shadow-card);
}

/* Vote Section */
.vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: var(--bg-subtle);
    border-right: 1px solid var(--border-color);
    min-width: 72px;
}

.vote-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-light);
    transition: all 0.15s;
}

.vote-btn:hover:not(.voted):not(:disabled) {
    border-color: var(--text-main);
}

.vote-btn:hover:not(.voted):not(:disabled) svg {
    color: var(--text-main);
    transform: translateY(-2px);
}

.vote-btn.voted {
    background: var(--accent);
    border-color: var(--accent);
}

.vote-btn.voted svg {
    color: var(--accent-text);
}

.vote-count {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 8px;
}

/* Card Content */
.card-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    letter-spacing: -0.2px;
}

.card-tag {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border-radius: 6px;
}

.card-tag.mobile-app {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

[data-theme="dark"] .card-tag.mobile-app {
    color: #34d399;
}

.card-tag.website {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

[data-theme="dark"] .card-tag.website {
    color: #60a5fa;
}

.card-tag.game {
    background: rgba(236, 72, 153, 0.15);
    color: #db2777;
}

[data-theme="dark"] .card-tag.game {
    color: #f472b6;
}

.card-tag.product {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

[data-theme="dark"] .card-tag.product {
    color: #fbbf24;
}

.card-desc {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.card-time {
    font-size: 13px;
    color: var(--text-light);
}

/* Empty State */
.empty {
    text-align: center;
    padding: 80px 40px;
    background: var(--bg-subtle);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.empty svg {
    width: 56px;
    height: 56px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-text {
    font-size: 15px;
    color: var(--text-muted);
}

/* Toast */
.toasts {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.toast {
    padding: 14px 24px;
    background: var(--text-main);
    color: var(--bg-body);
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    box-shadow: var(--shadow-toast);
    animation: toast-in 0.3s ease;
}

.toast.error {
    background: #dc2626;
    color: #ffffff;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cookie Toast */
.cookie-toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-toast);
    z-index: 9998;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-content {
    flex: 1;
}

.cookie-text {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.5;
    margin-bottom: 4px;
}

.cookie-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.cookie-btn {
    padding: 8px 16px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.cookie-btn:hover {
    opacity: 0.9;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 0 24px;
    }

    .layout {
        grid-template-columns: 1fr;
        gap: 48px;
        padding: 48px 0;
    }

    .left-col {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .tagline {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .layout {
        padding: 32px 0;
        gap: 32px;
    }

    .tagline {
        font-size: 24px;
    }

    .form-card {
        padding: 24px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .filter-btn {
        flex-shrink: 0;
    }

    .suggestion {
        flex-direction: column;
    }

    .vote {
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
        padding: 16px 20px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .vote-count {
        margin-top: 0;
    }

    .radio-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .cookie-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}