/* Reset and Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* -- BODY BASE STYLE -- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 40px 10px;
    color: #2e7d32;
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: linear-gradient(135deg, #a8e6cf, #dcedc8);
}

/* --------------------------------------------------------------------
   AUDIO PAGE STYLE
   Keep in container with class .audio-page to avoid conflicts
--------------------------------------------------------------------- */
.audio-page {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 25px;
    border-radius: 14px;
    box-shadow: 0 10px 15px rgba(46, 125, 50, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    max-width: 1080px;
    width: 100%;
    box-sizing: border-box;
}

.audio-page h1 {
    font-size: 2.6em;
    margin-bottom: 60px;
    font-weight: 700;
    color: #2b6e22;
    letter-spacing: 0.05em;
    user-select: none;
}

.audio-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 22px;
    justify-content: flex-start;
}

.audio-item {
    background: #f3f7e6;
    flex: 0 0 calc(33.333% - 15px);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.1);
    padding: 22px 22px 30px;
    display: flex;
    flex-direction: column;
    min-height: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.audio-item:hover {
    box-shadow: 0 14px 28px rgba(46, 125, 50, 0.2);
    transform: translateY(-6px);
}

.audio-item h3 {
    font-weight: 700;
    font-size: 1.2em;
    color: #2b6e22;
    margin: 0 0 10px;
    line-break: anywhere;
}

.audio-item p {
    font-size: 0.95em;
    color: #4a4a4a;
    margin: 3px 0 12px;
    line-height: 1.3;
}

.audio-item p strong {
    font-weight: 700;
    color: #317a00;
}

.audio-item audio {
    width: 100%;
    border-radius: 12px;
    background: #e0f0c0;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.6);
    margin: 14px 0 22px;
    outline-offset: 2px;
}

.audio-item .review-form,
.audio-item .reviews,
.audio-item .your-review {
    margin-top: auto;
    font-size: 0.92em;
    color: #3a3a3a;
}

.audio-item .review-form label,
.audio-item .reviews strong,
.audio-item .your-review strong {
    color: #2b6e22;
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
}

.rating {
    display: flex;
    gap: 9px;
    margin-bottom: 12px;
}

.star {
    font-size: 24px;
    color: #b0b0b0;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
}

.star.selected,
.star:hover,
.star:hover ~ .star {
    color: #ffcd00;
}

textarea[name="remark"],
textarea[name="transcript"] {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.8px solid #a8c17c;
    background: #ebf5d7;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    color: #2e531c;
}

textarea[name="remark"]:focus,
textarea[name="transcript"]:focus {
    outline: none;
    border-color: #56a811;
    background: #f6fdda;
}

button,
.btn {
    width: 80%;
    padding: 14px 0;
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 6px 14px rgba(76, 175, 80, 0.4), inset 0 2px 6px rgba(255, 255, 255, 0.25);
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    margin-top: 8px;
}

button:hover,
.btn:hover {
    background: linear-gradient(135deg, #388e3c, #4caf50);
    box-shadow: 0 8px 18px rgba(60, 125, 63, 0.6), inset 0 2px 9px rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.logout-btn {
    background: linear-gradient(135deg, #d32f2f, #f44336) !important;
    box-shadow: 0 5px 13px rgba(211, 47, 47, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    margin-top: 12px;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #b71c1c, #d32f2f) !important;
    box-shadow: 0 7px 20px rgba(191, 23, 23, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

.your-review {
    font-size: 0.93em;
    padding-top: 5px;
    color: #2b552c;
}

.your-review strong {
    font-weight: 700;
}

.reviews {
    font-size: 0.9em;
    line-height: 1.3;
    margin-bottom: 15px;
    border-top: 1px solid #c8e6c9;
    padding-top: 10px;
}

.reviews strong {
    font-weight: 700;
}

.reviews p + p {
    margin-top: 7px;
}

.audio-page > a {
    display: flex;
    justify-content: center;
    margin-top: 42px;
}

.audio-page > a button {
    max-width: 220px;
}

@media (max-width: 960px) {
    .audio-item {
        flex: 0 0 calc(50% - 16px);
        min-height: 40px;
    }
}

@media (max-width: 620px) {
    body {
        padding: 20px 5px;
        align-items: center;
    }
    .audio-page {
        padding: 25px 12px;
        max-width: 60%;
        border-radius: 14px;
    }
    .audio-list {
        gap: 20px;
    }
    .audio-item {
        flex: 0 0 100%;
        min-height:40px;
        max-width: 400px;
        margin: 0 auto;
        padding: 22px 18px 28px;
        box-shadow: 0 8px 20px rgba(46, 125, 50, 0.15);
    }
    button,
    .btn {
        font-size: 1.05em;
        padding: 14px 0;
    }
}

/* --------------------------------------------------------------------
   LOGIN PAGE STYLE (Vertically stacked username and password)
   Wrap login form with .login-container to scope styles
--------------------------------------------------------------------- */

.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px 30px;
    border-radius: 12px;
    box-shadow: 0 9px 25px rgba(60, 140, 40, 0.3);
    width: 360px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Center the form container vertically and horizontally */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    background: linear-gradient(135deg, #a8e6cf, #dcedc8);
    padding: 0;
    margin: 0;
}

.login-container h6 {
    font-weight: 750;
    font-size: 2.2em;
    color: #2b6e22;
    margin-bottom: 50px;
    user-select: none;
}

/* Form Styling */
form.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

form.login-form label {
    font-weight: 600;
    font-size: 1.1em;
    color: #317a00;
}

form.login-form input[type="text"],
form.login-form input[type="password"] {
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid #a8c17c;
    font-size: 1.05em;
    background: #ecf9db;
    color: #2b5a0e;
    transition: border-color 0.3s ease;
}

form.login-form input[type="text"]:focus,
form.login-form input[type="password"]:focus {
    border-color: #56a811;
    background: #f6fdda;
    outline: none;
}

form.login-form button {
    padding: 16px 0;
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    font-size: 1.3em;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(76, 175, 80, 0.55), inset 0 2px 8px rgba(255, 255, 255, 0.3);
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

form.login-form button:hover {
    background: linear-gradient(135deg, #388e3c, #4caf50);
    box-shadow: 0 11px 35px rgba(60, 125, 63, 0.8), inset 0 2px 10px rgba(255, 255, 255, 0.45);
    transform: translateY(-3px);
}

/* Signup link */
.signup-link {
    font-size: 1em;
    text-align: center;
    margin-top: 20px;
    color: #2b6e22;
}

.signup-link a {
    color: #3a874a;
    font-weight: 700;
    text-decoration: underline;
}

.signup-link a:hover {
    color: #1c3d0b;
    text-decoration: none;
}

/* Responsive Login */
@media (max-width: 400px) {
    .login-container {
        width: 90%;
        padding: 30px 20px;
    }
}
/* File input styling */
.file-input {
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #a8c17c;
    background: #ecf9db;
    font-size: 1.05em;
    color: #2b5a0e;
    margin-bottom: 18px;
    width: 100%;
}

.file-input:focus {
    border-color: #56a811;
    background: #f6fdda;
    outline: none;
}

/* Transcript textarea */
.upload-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid #a8c17c;
    background: #ebf5d7;
    font-size: 1em;
    resize: vertical;
    margin-bottom: 20px;
}





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

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Common style for inputs and selects */
.input-style,
.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #aaa;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}


.back-btn {
    position: fixed;
    top: 20px;
    right: 25px;

    background-color: #2b7a3d;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    font-weight: bold;

    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: 0.2s ease;
}

.back-btn:hover {
    background-color: #256a35;
    transform: scale(1.05);
}
.reviews p {
    margin: 3px 0 !important;   /* reduce top-bottom spacing */
    padding: 0;
}









.review-summary {
    background: #f7fbf7;
    border: 1px solid #d0e6d0;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}



.edit-transcript-box {
    margin-top: 18px;
    padding: 15px;
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    background: #f9fff9;
}

.edit-transcript-box h4 {
    margin-bottom: 12px;
    color: #2e7d32;
}

.transcript-group {
    margin-bottom: 12px;
}

.transcript-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.transcript-group textarea {
    width: 100%;
    resize: vertical;
}

.update-btn {
    width: 100%;
    background: #4caf50;
    color: white;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
}
