/* style.css - Inspired by CSS Zen Garden (https://csszengarden.com/001/) */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lora', serif;
    background: linear-gradient(to bottom, #e4f5fb 0%, #90defb 100%);
    color: #3a3a2e;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 50px auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #aaaaaa;
}

.login-container {
    max-width: 400px;
    margin: 50px auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #d8d8c2;
}

h1 {
    text-align: center;
    color: #4a4c52;
    font-weight: 600;
    margin-bottom: 30px;
    font-size: 2.2em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

h2 {
    color: #4a4c52;
    font-weight: 500;
    margin: 20px 0 15px;
    font-size: 1.5em;
}

h3 {
    color: #4a4c52;
    font-weight: 500;
    margin-bottom: 15px;
}

/* Button Row for Reports Page */
.button-row {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.button-row form,
.button-row button {
    width: 20%;
}

.button-row form button {
    width: 100%;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.name-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.name-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a4a3a;
    font-size: 1.1em;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cccccc;
    border-radius: 8px;
    background: #eff8fb;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: 'Lora', serif;
    font-size: 1em;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: #1ba2ab;
    box-shadow: 0 0 5px rgba(27, 162, 171, 0.3);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input[type="radio"],
input[type="checkbox"] {
    width: 18px;
    margin-right: 10px;
    vertical-align: middle;
}

input[type="radio"] {
    accent-color: #1ba2ab;
}

input[type="checkbox"] {
    accent-color: #1ba2ab;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #1ba2ab;
    border-radius: 4px;
    background-color: #eff8fb;
    transition: background-color 0.3s, border-color 0.3s;
    height: 20px;
}

input[type="checkbox"]:checked {
    background-color: #1ba2ab;
    border-color: #1ba2ab;
    position: relative;
}

input[type="checkbox"]:checked::after {
    content: '\2714';
    color: #fffef8;
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

input[type="checkbox"]:hover:not(:checked) {
    background-color: rgba(27, 162, 171, 0.1);
}

/* Buttons */
button, .button {
    background: linear-gradient(to bottom, #97cfd3 0%, #1ba2ab 100%);
    color: #fffef8;
    padding: 12px 25px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1em;
    transition: background 0.3s, transform 0.2s;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
}

button:hover, .button:hover {
    background: linear-gradient(to bottom, #97cfd3 0%, #1ba2ab 100%);
    transform: translateY(-1px);
}

.vote-button {
    background: linear-gradient(to bottom, #99e3e8 0%, #1dc8d3 100%);
    padding: 15px 30px;
    font-size: 1.1em;
}

.vote-button:hover {
    background: linear-gradient(to bottom, #97cfd3 0%, #1ba2ab 100%);
}

.logout-form button {
    background: linear-gradient(to bottom, #d8a7b1 0%, #c98a97 100%);
}

.logout-form button:hover {
    background: linear-gradient(to bottom, #c98a97 0%, #b07a85 100%);
}

/* Specific Sections */
.question {
    margin: 20px 0;
    padding: 15px;
    background: #eff8fb;
    border-radius: 10px;
    border: 1px solid #cccccc;
}

.checkbox-group {
    margin: 20px 0;
    padding: 15px;
    background: #eff8fb;
    border-radius: 10px;
    border: 1px solid #cccccc;
}

.radio-group {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 2px;
}

.radio-group label {
    margin-right: 20px;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
}

.checkbox-options {
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 2px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-options label {
    font-weight: 400;
    margin: 0;
}

.question-item {
    background: #eff8fb;
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #cccccc;
}

.question-item .edit-form {
    flex-grow: 1;
    margin-right: 15px;
}

.question-item textarea,
.question-item select,
.question-item input[type="text"] {
    min-height: 60px;
    margin: 5px 0;
}

/* Results Section */
.majority {
    margin-top: 30px;
    padding: 15px;
    background: #eff8fb;
    border-radius: 10px;
    border: 1px solid #cccccc;
}

.majority p {
    margin: 10px 0;
}

.winner {
    color: #4a4c52;
    font-weight: 600;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #eff8fb;
    font-size: 0.9em;
}

th, td {
    padding: 12px;
    text-align: left;
    border: 1px solid #cccccc;
}

th {
    background: #d9eff5;
    color: #4a4a3a;
    font-weight: 600;
    cursor: pointer;
}

th:hover {
    background: #c5e8f0;
}

tr:nth-child(even) {
    background: #e6f6f9;
}

.sort-asc:after {
    content: ' ↑';
    color: #4a4a3a;
}

.sort-desc:after {
    content: ' ↓';
    color: #4a4a3a;
}

/* Links */
a {
    color: #a2b5b5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

a:hover {
    color: #3d5151;
}

.admin-link {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 24px;
    color: #a2b5b5;
}

.admin-link:hover {
    color: #3d5151;
}

/* Messages */
.error {
    color: #d8a7b1;
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
    display: block;
}

.success {
    color: #1dc8d3;
    font-size: 0.9em;
    margin-top: 20px;
    text-align: center;
}

/* Logout Form */
.logout-form {
    text-align: right;
    margin-bottom: 20px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
    body {
        background: white;
        padding: 0;
        margin: 0;
    }
    .container, .login-container {
        box-shadow: none;
        border: none;
        padding: 10px;
        max-width: 100%;
    }
    h1 {
        font-size: 1.2em;
        margin: 10px 0;
    }
    table {
        font-size: 0.8em;
        margin: 0;
    }
    th, td {
        padding: 6px;
        border: 1px solid #cccccc;
    }
    th {
        background: #d9eff5;
    }
    tr:nth-child(even) {
        background: #e6f6f9;
    }
    button, a, form {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .name-row {
        flex-direction: column;
        gap: 10px;
    }
    .container, .login-container {
        padding: 20px;
        margin: 20px auto;
    }
    .admin-link {
        top: 15px;
        right: 15px;
    }
    table {
        font-size: 0.8em;
    }
    th, td {
        padding: 8px;
    }
    .button-row {
        flex-direction: column;
        gap: 10px;
    }
    .button-row form,
    .button-row button {
        width: 100%;
    }
}