/* --- Root Variables for Theming --- */
:root {
    --primary-color: #005A9C; /* Blue for primary elements */
    --primary-color-hover: #004a80; /* A darker blue for hover */
    --secondary-color: #6c757d; /* A neutral silver/grey for secondary accents */
    --secondary-color-hover: #5a6268; /* A darker grey for hover */
    --background-color-start: #eef3f7;
    --background-color-end: #ffffff;
    --text-color: #3c4858;
    --header-footer-bg: rgba(255, 255, 255, 0.7);
    --border-color: #d1d9e6;
    --success-color: #28a745;
    --shadow-light: #ffffff;
    --shadow-dark: rgba(55, 84, 170, 0.15);
}

/* =================================================================
   BASE & LAYOUT STYLES
================================================================= */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--background-color-start), var(--background-color-end));
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased; /* Smoother fonts */
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    background: var(--background-color-start);
    border-radius: 20px;
    box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: fadeIn 0.5s ease-in-out; /* Add a subtle fade-in animation */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 { font-size: 2.5rem; text-align: center; color: var(--primary-color); font-weight: 700; }
h2 { font-size: 1.8rem; text-align: center; color: var(--primary-color); }

/* =================================================================
   HEADER & FOOTER
================================================================= */
.header { 
    padding: 10px 20px; 
    text-align: center; 
    border-bottom: 1px solid var(--border-color);
    position: relative;
    background-color: #ffffff; 
}
.header img { max-width: 100%; height: auto; max-height: 120px; }

.footer { 
    padding: 20px; 
    text-align: center; 
    border-top: 1px solid var(--border-color); 
    background: rgba(249, 250, 251, 0.5);
}
.footer-links { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    flex-wrap: wrap;
    gap: 20px; 
}
.footer-links img { 
    width: 40px; 
    height: 40px; 
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
}
.footer-links a:hover img {
    transform: scale(1.15);
    opacity: 1;
}

/* =================================================================
   UI ELEMENTS & FORM
================================================================= */
#fullscreen-button {
    position: absolute; top: 15px; right: 15px; width: 40px; height: 40px;
    background: transparent; border: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512' fill='%23005A9C'%3E%3Cpath d='M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zm384 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H416zM64 320c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H96v-64c0-17.7-14.3-32-32-32zm320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V352c0-17.7-14.3-32-32-32H384z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 50%;
    opacity: 0.7; transition: opacity 0.3s;
}
#fullscreen-button:hover { opacity: 1; }

.complaint-section { padding: 20px 40px; }
#datetime { text-align: center; margin-bottom: 20px; font-size: 0.9rem; color: #666; }

.complaint-form { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; align-items: center; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { padding-right: 10px; }
.form-group input { width: 100%; }

.complaint-form label { font-weight: 600; display: flex; align-items: center; }
.complaint-form label svg { margin-right: 8px; width: 1.2em; height: 1.2em; flex-shrink: 0; color: var(--primary-color); }

.complaint-form input, .complaint-form textarea, .complaint-form select {
    width: 100%; padding: 12px 15px; border: none;
    border-radius: 10px; box-sizing: border-box;
    background-color: var(--background-color-start);
    box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: var(--text-color);
}

.complaint-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23005A9C' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px 16px;
}

.complaint-form input:focus, .complaint-form textarea:focus, .complaint-form select:focus {
    outline: none;
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light), 0 0 0 3px rgba(0, 90, 156, 0.2);
}

.complaint-form button[type="submit"] {
    background: var(--primary-color);
    color: white; border: none; padding: 15px; border-radius: 10px;
    font-size: 1.1rem; font-weight: 600; cursor: pointer;
    grid-column: 1 / -1;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    transition: all 0.3s ease;
}
.complaint-form button[type="submit"]:hover {
    background: var(--primary-color-hover);
}
.complaint-form button[type="submit"]:active {
    box-shadow: inset 5px 5px 10px #004a80, inset -5px -5px 10px #006ac8;
}

.full-width-label, .full-width-input { grid-column: 1 / -1; }

/* --- Upload & Image Previews --- */
.upload-options { display: flex; gap: 15px; justify-content: center; grid-column: 1 / -1; }
.upload-btn {
    display: flex; align-items: center; justify-content: center;
    width: 60px; height: 60px;
    border: none;
    background-color: var(--background-color-start); border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}
.upload-btn svg {
    width: 24px; height: 24px;
    stroke: var(--secondary-color);
}
.upload-btn:hover { background-color: var(--secondary-color); }
.upload-btn:hover svg { stroke: white; }
.upload-btn:active {
    box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
}
.hidden-file-input { display: none; }

#imagePreviewsContainer {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px; margin-top: 10px; grid-column: 1 / -1;
}
.image-preview-wrapper { position: relative; width: 100%; padding-top: 100%; }
.image-preview {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 10px;
}

/* =================================================================
   STATUS & POPUP STYLES
================================================================= */
.status-message { padding: 15px; margin-bottom: 20px; border-radius: 8px; }
.status-warning { background-color: #fff3cd; color: #856404; }
.hidden { display: none; }

.popup-modal {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    justify-content: center; align-items: center;
}
.popup-content {
    background-color: var(--background-color-start); padding: 30px; border-radius: 12px;
    width: 90%; max-width: 500px; text-align: center;
}
.progress-bar-container { width: 100%; background-color: #e9ecef; border-radius: 20px; margin: 20px 0; }
.progress-bar-fill { height: 25px; width: 0%; background: var(--success-color); border-radius: 20px; }
#progress-text { font-weight: 600; }

/* =================================================================
   SUCCESS PAGE & ACTION BUTTONS
================================================================= */
.success-container { padding-bottom: 30px; }
.success-content { padding: 20px 40px; text-align: center; }
.success-icon { font-size: 5rem; color: var(--success-color); line-height: 1; margin-bottom: 1rem; }
.ticket-details {
    text-align: left; background-color: #f8f9fa;
    border: 1px solid var(--border-color); border-radius: 8px;
    padding: 20px; margin-top: 20px;
}
.ticket-details h2 { margin-top: 0; text-align: left; font-size: 1.5rem; }
.ticket-details p { margin: 10px 0; }
.ticket-details strong { color: var(--primary-color); }
.status-open {
    background-color: var(--success-color); color: white;
    padding: 3px 8px; border-radius: 15px; font-size: 0.9rem;
}
.description-box {
    background-color: #fff; padding: 15px;
    border-radius: 5px; border: 1px solid #ccc;
    margin-top: 5px; min-height: 80px;
}
.action-buttons {
    text-align: center; padding: 20px;
    display: flex; justify-content: center; gap: 15px;
}
.screenshot-button, .back-button {
    padding: 12px 25px; border-radius: 10px; font-weight: 600;
    text-decoration: none; cursor: pointer; border: none;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}
.screenshot-button { background-color: var(--primary-color); color: white; }
.screenshot-button:hover { background-color: var(--primary-color-hover); }

.back-button { background-color: var(--secondary-color); color: white; }
.back-button:hover { background-color: var(--secondary-color-hover); }

.submitted-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}
.submitted-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.submitted-images a:hover img {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

/* =================================================================
   RESPONSIVE DESIGN (MOBILE)
================================================================= */
@media (max-width: 768px) {
    body { padding: 10px; }
    .container { margin: 10px auto; }
    .complaint-section { padding: 20px; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    .upload-options { flex-direction: row; }
    .footer-links img { width: 35px; height: 35px; }
    #imagePreviewsContainer { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
}
