/* ====================================
   Styling untuk Aplikasi Buku Tamu
   ==================================== */

:root {
    --primary-color: #1a7d5e;
    --secondary-color: #1a7d5e;
    --success-color: #1a7d5e;
    --warning-color: #1a7d5e;
    --danger-color: #1a7d5e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a7d5e;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Header Styling */
header {
    background: #1a7d5e;
    border-radius: 15px;
    padding: 30px 30px 40px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    display: block;
}

header h1 {
    color: white;
    margin-bottom: 15px;
    margin-top: 0;
    font-size: 2.5rem;
    font-weight: 700;
}

header p {
    color: #ecf0f1;
    font-size: 1.1rem;
}

/* Logo Section */
.logo-section {
    display: none;
}

.logo {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    filter: brightness(1.1) contrast(1.2) drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.08);
    filter: brightness(1.2) contrast(1.3) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.logo {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: brightness(1.1) contrast(1.2) drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.08);
    filter: brightness(1.2) contrast(1.3) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

header h1 {
    color: white;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

header p {
    color: #ecf0f1;
    font-size: 1.1rem;
}

/* Marquee Text Styling */
.marquee-text {
    color: #ecf0f1;
    font-size: 1.1rem;
    border: 3px solid #ecf0f1;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.2);
    display: block;
    width: 100%;
}

.school-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 0 auto 20px;
    padding: 14px 20px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    color: #fff;
    background: transparent;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.school-home-link:hover,
.school-home-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.school-home-link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* Stats Section */
.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.stat-box {
    background: #1a7d5e;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.stat-box h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.stat-box p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-box h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.stat-box p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Form Styling */
.form-section {
    background: linear-gradient(135deg, #ecf0f1 0%, #ffffff 100%);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-section h2 {
    color: #1a7d5e;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a7d5e;
    box-shadow: 0 0 0 3px rgba(26, 125, 94, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Camera */
.camera-box {
    position: relative;
    width: 100%;
    max-width: 520px;
    min-height: 290px;
    margin: 0 auto 15px;
    overflow: hidden;
    border-radius: 8px;
    background: #173d32;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-box video,
.camera-box img {
    display: none;
    width: 100%;
    height: 290px;
    object-fit: cover;
}

.camera-box video.active,
.camera-box img.active {
    display: block;
}

.camera-box canvas {
    display: none;
}

.camera-message {
    color: white;
    padding: 20px;
    text-align: center;
}

.camera-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.camera-button {
    background: #1a7d5e;
    color: white;
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
}

.camera-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Rating Section */
.rating-group {
    margin-bottom: 20px;
}

.rating-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.rating-options {
    display: flex;
    gap: 10px;
}

.rating-option {
    flex: 1;
}

.rating-option input[type="radio"] {
    display: none;
}

.rating-option label {
    display: block;
    padding: 12px;
    text-align: center;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.rating-option input[type="radio"]:checked + label {
    background: #1a7d5e;
    color: white;
    border-color: #1a7d5e;
}

/* Submit Button */
.btn-submit {
    background: #1a7d5e;
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(26, 125, 94, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
    font-size: 32px;
    font-weight: 700;
    text-align: center;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

/* Entries List */
.entries-section {
    background: linear-gradient(135deg, #ecf0f1 0%, #ffffff 100%);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.entries-section h2 {
    color: #1a7d5e;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.entry-card {
    background: #f9f9f9;
    border-left: 4px solid #1a7d5e;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    transition: all 0.3s;
}

.entry-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.entry-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.entry-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.entry-email {
    color: #0a5c42;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.entry-contact {
    background: #f0f8f5;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid #0a5c42;
}

.entry-phone {
    color: #0a5c42;
    font-size: 0.9rem;
    margin-bottom: 6px;
    font-weight: 500;
}

.entry-phone i {
    margin-right: 6px;
}

.entry-address {
    color: #0a5c42;
    font-size: 0.9rem;
    margin-bottom: 6px;
    line-height: 1.4;
}

.entry-address i {
    margin-right: 6px;
}

.entry-email {
    color: #1a7d5e;
    font-size: 0.9rem;
}

.entry-email i {
    margin-right: 6px;
}

.category-badge {
    display: inline-block;
    background: #1a7d5e;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.entry-rating {
    margin-bottom: 10px;
    color: var(--warning-color);
}

.entry-message {
    color: #555;
    line-height: 1.6;
    font-style: italic;
}

.no-entries {
    text-align: center;
    padding: 40px 20px;
    color: var(--secondary-color);
}

.no-entries i {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Loading State */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .form-section,
    .entries-section {
        padding: 20px;
    }
    
    .rating-options {
        flex-wrap: wrap;
    }
    
    .entry-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .entry-date {
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .form-section,
    .entries-section {
        padding: 15px;
    }
}
