/* Style.css - Consolidated styles for your entire website, including Register.php, Index.php, and Dashboard.php */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'nunito', sans-serif;
    font-weight: 600;
}

html, body { /* Apply to both html and body */
    height: 100%; /* Ensure they take full height */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
    background: url(Images/Background.jpg); /* Original background path */
    background-size: cover;
    background-attachment: fixed; /* Added to make background stay fixed on scroll */
    background-position: center center; /* Center the background image */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.box {
    width: 400px; /* Default width, will be overridden by specific .box rules below for wider forms */
    height: 480px; /* Default height, will be overridden for longer forms */
    background: #fff;
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 2px 2px 15px 2px rgba(0,0,0,0.1),
                -2px -0px 15px 2px rgba(0,0,0,0.1);
    z-index: 10;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wrapper {
    position: absolute;
    width: 405px; /* Default width, will be overridden for wider forms */
    height: 500px; /* Default height, will be overridden for longer forms */
    border-radius: 30px;
    background: rgba(255,255,255,0.53);
    box-shadow: 2px 2px 15px 2px rgba(0,0,0,0.115),
                -2px -0px 15px 2px rgba(0,0,0,0.054);
    transform: rotate(5deg) scale(1.05);
    z-index: 0;
}

.header {
    margin-bottom: 10px;
    text-align: center;
}

.header header {
    display: flex;
    justify-content: center;
}

header img {
    width: 300px;
}

.header p {
    font-size: 25px;
    font-weight: 800;
    margin-top: 10px;
}

.input-box {
    position: relative;
    width: 100%;
    margin: 15px 0;
    display: flex; /* Ensure flex for label-above-input layout */
    flex-direction: column; /* Stack label and input vertically */
}

.input-box label {
    position: static; /* Remove absolute positioning */
    transform: none; /* Remove transform */
    margin-bottom: 5px; /* Space between label and input */
    font-size: 0.9rem;
    color: #555;
    pointer-events: auto; /* Allow label to be selectable */
    transition: none; /* Remove transition if not needed for static labels */
}

/* Re-added icon styling */
.input-box i {
    font-size: 22px;
    position: absolute;
    right: 12px;
    color: #595b5e;
    top: 45px; /* Adjusted to better center with input fields when label is above */
    transform: none; /* Removed translateY */
}

input {
    width: 100%;
    height: 40px;
    border: 2px solid rgb(153,157,158);
    border-radius: 7px;
    padding: 0 40px 0 10px; /* Reverted padding to accommodate icon */
    outline: none;
}

.input-field {
    font-weight: 500;
    font-size: 17px;
    color: #333;
    background: transparent;
    transition: all .3s ease-in-out;
}

.input-field:focus {
    border: 2px solid rgb(89,53,180);
}

/* Re-added focus/valid label and icon styling */
.input-field:focus ~ label,
.input-field:valid ~ label {
    top: -5px;
    font-size: 14px;
    color: rgb(89,53,180);
}

.input-field:focus ~ i {
    color: rgb(89,53,180);
}

.input-submit {
    background: #1e263a;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all .3s ease-in-out;
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

.input-submit:hover {
    background: #122b71;
}

.input-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.bottom {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    margin-top: 25px;
    width: 100%;
    font-size: 0.9rem;
    color: #777;
    flex-wrap: wrap;
}

.bottom span {
    margin: 0 10px;
}

.bottom span a {
    color: #727374;
    text-decoration: none;
}

.bottom span a:hover {
    text-decoration: underline;
}

/* --- Register.php Specific Styles (Previously in RegisterStyle.css) --- */

/* Override .box and .wrapper dimensions for the longer registration form */
/* Note: These rules specifically target the .box and .wrapper used for the registration form,
   overriding the general .box and .wrapper rules above when applied to the Register page. */
.container .box {
    width: 600px; /* Wider for desktop */
    max-width: 90%; /* Responsive max-width */
    min-height: 600px; /* Ensure enough height for content */
    height: auto !important; /* Allow height to expand based on content */
    padding-bottom: 50px; /* Ensure space at the bottom */
}

.container .wrapper {
    width: calc(600px + 5px); /* Match box width + offset */
    min-height: 620px; /* Slightly taller than box */
    height: auto !important; /* Allow height to expand */
}

/* Adjustments for input-box for labels above inputs */
.input-box {
    display: flex;
    flex-direction: column; /* Stack label and input vertically */
    margin: 10px 0; /* Adjust vertical spacing between input groups */
    position: relative; /* Essential for positioning the custom dropdown arrow */
}

/* For labels that are positioned above the input field */
.input-box label {
    position: static; /* Remove absolute positioning from general Style.css */
    transform: none; /* Remove transform from general Style.css */
    margin-bottom: 5px; /* Space between label and input */
    font-size: 0.9rem;
    color: #555;
    pointer-events: auto; /* Allow label to be selectable */
    transition: none; /* Remove transition if not needed for static labels */
}

/* Re-added .input-box i styling for Register.php specific icon positioning */
.input-box i {
    top: 45px; /* Adjusted to better center with input fields when label is above */
    transform: none; /* Removed translateY */
}

/* Ensure input fields have enough padding */
.input-field {
    padding: 0 40px 0 10px; /* Reverted padding to accommodate icon */
}

/* Specific styles for textarea within input-box */
textarea.input-field {
    padding: 10px; /* Standard padding for multiline text */
    resize: vertical; /* Allow vertical resizing */
    min-height: 60px;
}

/* Styling for select dropdown to match input fields and manage custom arrow */
.input-box select.input-field {
    /* Remove default browser styling for consistency */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Add a custom arrow */
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23595b5e" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    /* Position the custom arrow to the left of the bx icon */
    background-position: calc(100% - 40px) center; /* 40px from right edge to account for bx icon */
    background-size: 20px; /* Size of the custom arrow */
    padding-right: 60px; /* Increase right padding to make space for both custom arrow and bx icon */
    /* Inherit other styles from .input-field */
}


/* Form Section Headers */
form h3 {
    width: 100%;
    text-align: left;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #595b5e;
    font-size: 1.2rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    font-weight: 800;
}

.required {
    color: #e74c3c; /* Red color for required indicator */
    font-weight: bold;
}

/* Radio Button Group (now dropdown) */
/* This class is no longer directly used for gender, but kept for other potential radio groups */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
    margin-bottom: 10px;
}

.radio-group label {
    font-weight: normal; /* Override general font-weight for radio labels */
}

.help-text {
    font-size: 0.85rem;
    color: #777;
    margin-top: 5px;
    margin-left: 5px;
}

/* Message Box Styling */
.message-box {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    box-sizing: border-box;
    background-color: #e0f7fa; /* Light blue for general messages */
    color: #00796b; /* Dark teal */
    border: 1px solid #b2ebf2;
    font-weight: 600;
}
.message-box.error {
    background-color: #ffebee;
    color: #c62828;
    border-color: #ef9a9a;
}
.message-box.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

/* Camera Specific Styles */
.camera-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
}

video {
    width: 100%;
    max-width: 320px;
    height: auto;
    border: 2px solid #595b5e;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #000;
    display: none;
}

canvas {
    display: none;
    width: 100%;
    max-width: 320px;
    height: auto;
    border: 2px solid #595b5e;
    border-radius: 8px;
    margin-top: 10px;
}

.camera-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.camera-button {
    padding: 10px 15px;
    background: #1e263a;
    color: #fff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all .3s ease-in-out;
    font-weight: 600;
}

.camera-button:hover {
    background: #122b71;
}

.camera-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#capturedImagePreview {
    display: none;
    max-width: 150px;
    height: auto;
    margin-top: 15px;
    border: 2px solid #28a745;
    border-radius: 8px;
}

/* --- Dashboard Specific Styles --- */
.dashboard-box { /* Specific class for dashboard to avoid conflict with register form */
    width: 700px; /* Wider for dashboard */
    max-width: 95%; /* Responsive max-width */
    min-height: 600px; /* Ensure enough height for content */
    height: auto !important; /* Allow height to expand based on content */
    padding-bottom: 50px; /* Ensure space at the bottom */
}


.dashboard-content {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr; /* Default to single column */
    gap: 20px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .dashboard-content {
        grid-template-columns: 1fr 1fr; /* Two columns on larger screens */
    }
    .profile-section {
        grid-column: span 2; /* Profile section spans full width on desktop */
        text-align: center;
    }
    .additional-info-section {
        grid-column: span 2; /* Additional info section spans full width on desktop */
    }
}

.profile-section,
.account-section,
.additional-info-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.profile-section h3,
.account-section h3,
.additional-info-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1e263a;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
    font-size: 1.1rem;
}

.profile-section p,
.account-section p,
.additional-info-section p {
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.profile-section p:last-child,
.account-section p:last-child,
.additional-info-section p:last-child {
    margin-bottom: 0;
}

.member-selfie {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #007bff;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Blinking Red effect for Debt */
@keyframes blink {
    0% { color: red; }
    50% { color: transparent; }
    100% { color: red; }
}

.blinking-red {
    color: red;
    animation: blink 1s linear infinite;
    font-weight: bold;
}

.logout-button-container {
    margin-top: 30px;
    text-align: center;
}

/* New style for LoginMsg when displayed on dashboard and marked red */
.message-box.login-msg-red {
    background-color: #ffebee; /* Light red background */
    color: #c62828; /* Dark red text */
    border-color: #ef9a9a; /* Red border */
    font-weight: bold;
}


/* --- Responsive Adjustments --- */

/* For Tablets and smaller desktops (max-width: 768px) */
@media (max-width: 768px) {
    .container .box {
        width: 90%; /* Occupy more width on smaller screens */
        padding: 25px; /* Reduce padding */
        min-height: auto; /* Allow height to be more flexible */
    }

    .container .wrapper {
        width: 95%;
        min-height: auto;
        transform: rotate(5deg) scale(1.02); /* Slightly less scale */
    }

    .header p {
        font-size: 22px; /* Slightly smaller font for header text */
    }

    /* Adjust for icons in responsive layout */
    .input-box i {
        top: 50%; /* Revert to 50% for smaller screens if that works better with general Style.css's base */
        transform: translateY(-50%);
        font-size: 20px;
    }

    .input-field {
        font-size: 16px; /* Slightly smaller font for input fields */
        padding: 0 35px 0 10px; /* Reverted padding to accommodate icon */
    }

    textarea.input-field {
        padding: 8px; /* Reduce textarea padding */
    }

    form h3 {
        font-size: 1.1rem; /* Smaller section headers */
        margin-top: 20px;
        margin-bottom: 10px;
    }

    .camera-container video,
    .camera-container canvas {
        max-width: 280px;
    }

    .camera-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .camera-button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .modal-content {
        width: 90%; /* More width on smaller screens */
        padding: 20px;
    }
}

/* For Mobile phones (max-width: 480px) */
@media (max-width: 480px) {
    .container .box {
        width: 95%;
        padding: 20px;
    }

    .container .wrapper {
        width: 100%;
        transform: rotate(5deg) scale(1.01);
    }

    .header img {
        width: 200px;
    }

    .header p {
        font-size: 20px;
    }

    .input-box {
        margin: 8px 0;
    }

    .input-box label {
        font-size: 0.85rem;
    }

    /* Adjust for icons in responsive layout */
    .input-box i {
        top: 50%; /* Keep 50% and translateY for consistent centering */
        transform: translateY(-50%);
        font-size: 18px;
    }

    .input-field {
        height: 38px;
        font-size: 15px;
        padding: 0 30px 0 8px; /* Reverted padding to accommodate icon */
    }

    textarea.input-field {
        min-height: 50px;
    }

    form h3 {
        font-size: 1rem;
        margin-top: 15px;
        margin-bottom: 8px;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .camera-container video,
    .camera-container canvas {
        max-width: 240px;
    }

    .camera-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .camera-button {
        padding: 10px;
        font-size: 0.95rem;
    }

    .bottom {
        flex-direction: column;
        gap: 8px;
        margin-top: 20px;
    }

    .bottom span {
        margin: 0;
    }

    .modal-content {
        padding: 15px;
    }

    .modal-content h2 {
        font-size: 1.1rem;
    }

    .modal-content p {
        font-size: 0.9rem;
    }

    .close-button {
        font-size: 24px;
        top: 5px;
        right: 10px;
    }
}
