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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    color: #333;
    padding: 30px;
    text-align: center;
}

.admin-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.admin-links .menu-link {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.admin-links .menu-link:hover {
    background: #5a6fd8;
}

.admin-links .logout-link {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.admin-links .logout-link:hover {
    background: #c82333;
}

.login-form {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Form styles */
.rsvp-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Radio buttons */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.radio-label:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.radio-label input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #e8f2ff;
}

/* Potato options */
.potato-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 15px;
}

.potato-item {
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.potato-item label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.potato-item input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.potato-image {
    max-width: 100px;
    max-height: 75px;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.potato-description {
    font-size: 14px;
    color: #666;
    margin: 4px 0 8px 0;
    font-style: italic;
    line-height: 1.4;
}

.menu-admin-form {
    padding: 30px;
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.menu-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e1e1e1;
}

.menu-item h3 {
    margin-bottom: 15px;
    color: #333;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

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

.delete-form {
    margin: 0;
}

.menu-item-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e1e1;
}

.add-new-item {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e1e1e1;
}

.add-new-item h3 {
    margin-bottom: 15px;
    color: #333;
}

.add-item-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.add-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    align-self: flex-start;
}

.add-btn:hover {
    background: #218838;
}

.menu-item .form-group {
    margin-bottom: 15px;
}

.menu-item input[type="text"],
.menu-item textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

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

.menu-item input[type="file"] {
    margin-top: 5px;
}

.current-image {
    margin-bottom: 10px;
    text-align: center;
}

.current-image img {
    border-radius: 5px;
    border: 1px solid #ddd;
}

.current-image p {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.menu-item small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.option-group {
    display: flex;
    flex-direction: column;
}

.option-group label {
    margin-bottom: 5px;
    font-size: 14px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: #667eea;
    background: #e8f2ff;
}

/* Hidden class */
.hidden {
    display: none;
}

/* Submit button */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Success message */
.success-message {
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.success-message h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.2rem;
}

.success-message p {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #555;
}

.back-link {
    display: inline-block;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.back-link:hover {
    background: #5a6fd8;
}

/* Admin styles */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 30px;
    background: #f8f9fa;
}

.potato-stats {
    padding: 20px 30px;
}

.potato-stats h3 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-card h3, .stat-card h4 {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card.highlight h3, .stat-card.highlight .stat-number {
    color: white;
}

.stat-card.attending {
    border-left-color: #28a745;
}

.stat-card.not-attending {
    border-left-color: #dc3545;
}

.stat-card.cakes {
    border-left-color: #ffc107;
}

.stat-card.total-potatoes {
    border-left-color: #6f42c1;
}

.potato-breakdown {
    margin-top: 20px;
}

.potato-item-stat {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #e1e1e1;
}

.potato-stat-image {
    max-width: 60px;
    max-height: 60px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
}

.potato-stat-info {
    flex: 1;
}

.potato-stat-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.potato-count {
    display: flex;
    align-items: baseline;
    margin-top: 8px;
}

.count-number {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin-right: 5px;
}

.count-label {
    color: #666;
    font-size: 14px;
}

.stats-footer {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e1e1e1;
}

.stats-footer p {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.stats-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.stats-link {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.stats-link:hover {
    background: #5a6fd8;
}

.stats-separator {
    color: #666;
}

.stats-note {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.stats-link-section {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
}

.stats-preview-link {
    display: inline-block;
    background: #f8f9fa;
    color: #667eea;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid #667eea;
    font-weight: 600;
    transition: all 0.3s ease;
}

.stats-preview-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.no-rsvps {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.rsvp-list {
    padding: 0 30px 30px;
}

.rsvp-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #667eea;
}

.rsvp-card.not-attending {
    border-left-color: #ff6b6b;
    opacity: 0.8;
}

.rsvp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.rsvp-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-btn, .delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.edit-btn:hover {
    background: #e3f2fd;
}

.delete-btn:hover {
    background: #ffeaea;
}

.rsvp-header h3 {
    color: #333;
    margin: 0;
}

.status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status.attending {
    background: #d4edda;
    color: #155724;
}

.status.not-attending {
    background: #f8d7da;
    color: #721c24;
}

.rsvp-details p {
    margin-bottom: 8px;
    color: #555;
}

.potato-list {
    margin: 5px 0 10px 0;
    padding-left: 20px;
}

.potato-list li {
    margin-bottom: 3px;
    color: #666;
    font-size: 14px;
}

.rsvp-timestamp {
    font-size: 12px;
    color: #999;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.edit-form {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.rsvp-edit-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.edit-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.edit-section label {
    font-weight: 600;
    color: #333;
}

.edit-section input, .edit-section select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.edit-menu-section {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
    margin-top: 10px;
}

.menu-item-edit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.menu-item-edit label {
    flex: 1;
    font-weight: normal !important;
}

.menu-item-edit input {
    width: 80px;
    flex-shrink: 0;
}

.edit-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.save-btn, .cancel-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.save-btn {
    background: #28a745;
    color: white;
}

.save-btn:hover {
    background: #218838;
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background: #545b62;
}

/* Responsive */
@media (max-width: 768px) {
    .stats {
        grid-template-columns: 1fr;
        padding: 15px 20px;
    }

    .potato-stats {
        padding: 15px 20px;
    }

    .menu-items {
        grid-template-columns: 1fr;
    }

    .admin-links {
        flex-direction: column;
        align-items: center;
    }

    .rsvp-actions {
        flex-direction: column;
        gap: 5px;
    }

    .menu-item-edit {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .menu-item-edit input {
        width: 100%;
    }

    .edit-buttons {
        flex-direction: column;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .potato-item-stat {
        flex-direction: column;
        text-align: center;
    }

    .potato-stat-image {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .stats-links {
        flex-direction: column;
        gap: 5px;
    }

    header h1 {
        font-size: 2rem;
    }

    .rsvp-form, .menu-admin-form {
        padding: 20px;
    }
}
