:root {
    --primary-color: #004bac;
    /* New primary color */
    --primary-hover: #004bad;
    /* Darker shade for hover */
    --text-primary: #2c3345;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --background-light: #f8fafc;
    --danger: #ef4444;
    --white: #ffffff;
}

body {
    margin: 0;
    padding: 0;
    background: var(--background-light);
    min-height: 100vh;
    background-image: url('../../frontend/asset/image/body-img.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 14px;
}

.page-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
    &::-webkit-scrollbar {
        display: none;
    }
}

/* .sidebar {
    width: 40%;
    position: fixed;
    height: 100vh;
    color: var(--white);
}

.sidebar-inner {
    background: var(--primary-color);
    height: 100%;
    clip-path: polygon(0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-content {
    text-align: center;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
} */
.auth-header {
    padding: 0.5rem 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo img {
    height: 60px;
}

.auth-button {
    -webkit-user-drag: none;
    text-decoration: none;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-button:hover {
    background: var(--primary-hover);
}

.auth-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.logout-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.logout-button {
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}

.logout-button:hover {
    background: var(--primary-hover);
}

.logout-button:focus {
    outline: 2px solid var(--primary-hover);
    outline-offset: 2px;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: none;
}

.form-wrapper {
    max-width: 800px;
    min-width: 320px;
    /* Added minimum width */
    margin: 0 auto;
    padding: 2rem 0;
}

.auth-wrapper {
    max-width: 400px;
    min-width: 320px;
    /* Added minimum width */
    width: 100%;
    margin: auto;
}

.form-container {
    background: rgb(255, 255, 255);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 75, 172, 0.2);
    padding: 2rem;
    min-width: 20rem;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.centered-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.page-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1rem;
    background-color: var(--background-light);
    padding: 12px 15px;
    margin: 20px 0 15px 0;
    border-radius: 6px;
    font-weight: 600;
    color: var(--text-primary);
    border-left: 4px solid var(--primary-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-col {
    flex: 1;
}

.input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.file-input-wrapper {
    position: relative;
    width: 100%;
}

.file-preview-link {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    z-index: 1;
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
}

.file-preview-link:hover {
    color: var(--secondary-color);
    filter: brightness(90%);
}

.form-input[type='file'] {
    width: 100%;
    font-size: 14px;
    color: var(--nav-text-color);
    padding: 8px 12px 8px 80px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: var(--input-bg-color);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-input[type='file']::before {
    content: 'Choose file';
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 12px;
    margin-left: -8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-input[type='file']:hover::before {
    filter: brightness(90%);
}

.form-input[type='file']::-webkit-file-upload-button {
    visibility: hidden;
    display: none;
}

.required {
    color: var(--danger);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;

    margin-top: 1.5rem;
    gap: 0.5rem;
}

.checkbox-wrapper input[type='checkbox'] {
    margin-top: 0.125rem;
    min-width: 1rem;
    min-height: 1rem;
    flex-shrink: 0;
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    flex-grow: 1;
}

.input-hint-wrapper {
    margin-top: 0.5rem;
    font-size: 0.875em;
    color: #6b7280;
    line-height: 1.4;
    max-width: 100%;
    word-wrap: break-word;
    padding-right: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1.5rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.text-center {
    text-align: center;
}

/* Auth specific styles */
.auth-page .main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 100vh;
}

.auth-page .page-title {
    margin-bottom: 0.5rem;
}

.auth-page .page-subtitle {
    margin-bottom: 2rem;
}

.forgot-password {
    display: block;
    text-align: right;
    color: var(--primary-color);
    font-size: 0.875rem;
    text-decoration: none;
    margin-top: 0.5rem;
}

.forgot-password:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.password-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.toggle-password i {
    font-size: 1rem;
}

/* Status and validation styles */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.invalid-input {
    border-color: #dc3545;
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    border: 1px solid #198754;
    color: #0f5132;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    color: #842029;
}

.alert-success i {
    color: #198754;
}

.alert-danger i {
    color: #dc3545;
}

label.error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

input.error {
    border-color: #dc3545;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 30%;
    }

    .main-content {
        margin-left: 30%;
    }
}

@media (max-width: 768px) {
    /* Allow scrolling on mobile for auth pages */
    body.auth-page {
        overflow: auto;
    }

    .page-layout {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        min-height: 200px;
    }

    .logout-container {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        text-align: right;
        padding-right: 0.5rem;
    }

    .logout-button {
        width: auto;
        padding: 6px 12px;
        font-size: 13px;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .auth-page .main-content {
        height: auto;
        min-height: calc(100vh - 200px);
        overflow: auto;
        /* Allow scrolling on mobile if needed */
    }

    .auth-wrapper,
    .form-wrapper {
        padding: 1rem 0;
        width: 100%;
        min-width: 280px;
        /* Ensure minimum width on mobile */
    }

    .form-container {
        padding: 1.5rem;
    }

    .input-hint-wrapper {
        font-size: 0.8125em;
        line-height: 1.3;
    }
}

@media screen and (max-width: 480px) {
    .input-hint-wrapper {
        font-size: 0.75em;
        margin-top: 0.375rem;
    }
}

/* Add styles for ultra-small screens */
@media (max-width: 320px) {
    .auth-wrapper,
    .form-wrapper,
    .form-container {
        padding-top: 3rem;
        min-width: 100%;
        /* Use full width on very small screens */
    }

    .logout-container {
        text-align: center;
        margin-top: 1rem;
        padding-bottom: 0.5rem;
    }

    .logout-button {
        width: 100%;
        /* Full width for very small screens */
        max-width: 150px;
        padding: 8px;
        font-size: 12px;
    }

    .main-content {
        padding: 1rem;
    }
}
