/* ========================================
   Feature Request Board — Prototype Styles
   Based on energy-package style guide
   ======================================== */

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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333333;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #129ca6;
    text-decoration: none;
}

a:hover {
    color: #0e8a93;
    text-decoration: underline;
}

/* ========================================
   Layout
   ======================================== */

.container {
    max-width: 1290px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

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

main {
    flex: 1;
    padding: 2.5rem 0;
}

/* ========================================
   Header
   ======================================== */

.header {
    background: #0e8a93;
    color: #ffffff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.header-nav a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    margin-left: 1.5rem;
}

.header-nav a:hover {
    color: #ffffff;
    text-decoration: none;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    background: #0e8a93;
    color: #ffffff;
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.footer-company {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-company strong {
    color: #ffffff;
}

.footer-email {
    color: #ffffff !important;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.footer-links a {
    color: #ffffff;
}

.footer-links a:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #129ca6;
    color: #ffffff;
    padding: 0.8rem 2rem;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: #0e8a93;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid #129ca6;
    color: #129ca6;
    padding: 0.8rem 2rem;
    border-radius: 9999px;
}

.btn-secondary:hover {
    background: #129ca6;
    color: #ffffff;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
}

.btn-danger {
    background: #dc3545;
    color: #ffffff;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.btn-danger:hover {
    background: #c82333;
}

/* ========================================
   Forms
   ======================================== */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #2e526a;
    font-size: 0.875rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: #333333;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #129ca6;
    box-shadow: 0 0 0 3px rgba(18, 156, 166, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.25rem;
}

/* ========================================
   Status Badges
   ======================================== */

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
}

.badge-uus {
    background: #129ca6;
}

.badge-plaanis {
    background: #0e8a93;
}

.badge-arenduses {
    background: #ffc107;
    color: #333333;
}

.badge-valmis {
    background: #28a745;
}

.badge-keeldutud {
    background: #999999;
}

/* ========================================
   Submit Form (always visible)
   ======================================== */

.submit-section {
    background: #f0fafa;
    border: 1px solid #c8e8eb;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.submit-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2e526a;
}

.submit-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.submit-form .form-group {
    margin-bottom: 0;
}

.submit-form .form-group-title {
    flex: 1;
    min-width: 200px;
}

.submit-form .form-group-desc {
    flex: 2;
    min-width: 200px;
}

.submit-form .form-actions {
    display: flex;
    align-items: flex-end;
}

.submit-form .form-input,
.submit-form .form-textarea {
    padding: 0.6rem 0.8rem;
}

.submit-form .form-textarea {
    min-height: 38px;
    height: 38px;
}

/* ========================================
   Filter Bar
   ======================================== */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #666666;
    margin-right: 0.5rem;
}

.filter-btn {
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 2px solid #e5e5e5;
    background: #ffffff;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: #129ca6;
    color: #129ca6;
}

.filter-btn.active {
    background: #129ca6;
    border-color: #129ca6;
    color: #ffffff;
}

/* ========================================
   Request Cards
   ======================================== */

.request-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.request-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 1rem;
    transition: box-shadow 0.2s ease;
    cursor: pointer;
}

.request-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Vote column */
.vote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    flex-shrink: 0;
}

.vote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 54px;
}

.vote-btn:hover {
    border-color: #129ca6;
    color: #129ca6;
}

.vote-btn.voted {
    border-color: #129ca6;
    color: #0e8a93;
    background: #edf8f9;
}

.vote-btn .vote-arrow {
    font-size: 1.2rem;
    line-height: 1;
}

.vote-btn .vote-count {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

/* Content column */
.request-content {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.request-content:hover {
    text-decoration: none;
    color: inherit;
}

.request-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.request-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e526a;
    line-height: 1.3;
}

.request-description {
    font-size: 0.9rem;
    color: #666666;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.request-meta {
    font-size: 0.8rem;
    color: #999999;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.request-meta .comment-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ========================================
   Request Detail Page
   ======================================== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: #666666;
    margin-bottom: 1.5rem;
}

.back-link:hover {
    color: #129ca6;
    text-decoration: none;
}

.detail-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.detail-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2e526a;
    margin-bottom: 0.5rem;
}

.detail-description {
    font-size: 1rem;
    color: #666666;
    line-height: 1.6;
    margin-top: 1rem;
}

.detail-meta {
    font-size: 0.875rem;
    color: #999999;
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

/* ========================================
   Comments
   ======================================== */

.comments-section {
    margin-top: 1.5rem;
}

.comments-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e526a;
    margin-bottom: 0.75rem;
}

.comment-form {
    background: #f0fafa;
    border: 1px solid #c8e8eb;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.comment-form .form-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.comment-form .form-group {
    margin-bottom: 0;
}

.comment-form .form-group-name {
    flex: 0 0 180px;
}

.comment-form .form-group-comment {
    flex: 1;
    min-width: 200px;
}

.comment-form .form-input,
.comment-form .form-textarea {
    padding: 0.6rem 0.8rem;
}

.comment-form .form-textarea {
    min-height: 38px;
    height: 38px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 1rem;
}

.comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comment-author {
    font-weight: 600;
    color: #2e526a;
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.8rem;
    color: #999999;
    margin-left: 0.75rem;
}

.comment-text {
    margin-top: 0.4rem;
    font-size: 0.95rem;
    color: #333333;
}

/* ========================================
   Admin Page
   ======================================== */

.login-card {
    max-width: 400px;
    margin: 4rem auto;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2e526a;
    margin-bottom: 1.5rem;
    text-align: center;
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
}

.admin-table thead th {
    background: #0e8a93;
    color: #ffffff;
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.admin-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    font-size: 0.9rem;
    vertical-align: middle;
}

.admin-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.admin-table tbody tr:hover {
    background: #edf8f9;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table .text-right {
    text-align: right;
}

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

.admin-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ========================================
   Privacy Policy Page
   ======================================== */

.legal-page {
    max-width: 800px;
}

.legal-page h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2e526a;
    margin-bottom: 1.5rem;
}

.legal-page h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2e526a;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-page p {
    margin-bottom: 1rem;
    color: #333333;
}

.legal-page ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-page ul li {
    margin-bottom: 0.5rem;
    color: #333333;
}

/* ========================================
   Error Messages
   ======================================== */

.error-message {
    background: #fff5f5;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    color: #333333;
    align-items: flex-start;
    gap: 0.75rem;
}

.error-message[hidden] {
    display: none;
}

.error-message:not([hidden]) {
    display: flex;
}

.error-message .error-icon {
    color: #dc3545;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999999;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 767px) {
    .header h1 {
        font-size: 1.2rem;
    }

    .request-card {
        flex-direction: column;
    }

    .vote-section {
        flex-direction: row;
        min-width: auto;
    }

    .vote-btn {
        flex-direction: row;
        gap: 0.4rem;
    }

    .detail-header {
        flex-direction: column;
    }

    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table thead th,
    .admin-table tbody td {
        padding: 0.5rem;
    }
}
