:root {
    --primary-color: #00b764;
    --secondary-color: #2c3e50;
    --accent-color: #ff6f61;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --sidebar-bg-color: white;
    --border-color: #dee2e6;
    --highlight-color: #f0fff4;
    --transition-speed: 0.3s ease;
    --border-radius: 8px;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --container-padding: 1rem;
    --card-padding: 1.5rem;
    --form-spacing: 1.25rem;
    --input-height: 45px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#mainContent {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    padding: clamp(1rem, 5vh, 3rem) 0;
}

.container {
    width: 100%;
    padding: var(--container-padding);
    margin: 0 auto;
    max-width: 100%;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    margin: 1rem auto;
    padding: var(--card-padding);
    width: 100%;
    max-width: 800px;
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: var(--card-padding);
    text-align: center;
}

.card-title {
    color: var(--secondary-color);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: var(--card-padding);
}

.logo {
    height: 45px;
    width: auto;
}

.form-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0 0 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.date-fields {
    font-size: clamp(0.9rem, 1vw, 1rem);
    color: var(--text-color);
    text-align: center;
    width: 100%;
}

.form-title {
    font-size: 1.5rem;
    text-align: center;
    margin: 0.5rem 0;
    line-height: 1.3;
    color: var(--secondary-color);
    font-weight: 600;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.form-control, .form-select {
    width: 100%;
    height: var(--input-height);
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #fff;
    color: var(--text-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 183, 100, 0.1);
    outline: none;
}

textarea.form-control {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

.row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--form-spacing);
    margin-bottom: var(--form-spacing);
}

.col-12 { grid-column: span 12; }
.col-md-8 { grid-column: span 12; }
.col-md-6 { grid-column: span 12; }
.col-md-4 { grid-column: span 12; }

@media (min-width: 768px) {
    :root {
        --container-padding: 2rem;
        --card-padding: 2rem;
        --form-spacing: 1.5rem;
        --input-height: 48px;
    }

    body {
        font-size: 15px;
    }

    .col-md-8 { grid-column: span 8; }
    .col-md-6 { grid-column: span 6; }
    .col-md-4 { grid-column: span 4; }
}

.gender-group {
    display: flex;
    gap: 2rem;
    padding: 0.5rem 0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    cursor: pointer;
}

.form-check-label {
    font-size: 0.95rem;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.declaration {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: clamp(1rem, 3vw, 1.5rem);
    margin: 2rem 0;
    text-align: center;
    border: 1px solid var(--border-color);
}

.declaration-text {
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 1.5rem;
    margin: 2rem 0;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
}

.declaration-name {
    display: inline-block;
    min-width: 200px;
    border-bottom: 1px dashed var(--primary-color);
    margin: 0 0.5rem;
    color: var(--primary-color);
}

.submit-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.btn {
    height: var(--input-height);
    padding: 0 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    color: white;
    min-width: 200px;
}

.btn-primary:hover {
    background-color: #009e54;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 183, 100, 0.2);
}

.btn-secondary {
    background-color: #6c757d;
    border: none;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
}

.footer {
    margin-top: 2rem;
    padding: 1rem 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .submit-section {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .gender-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .container {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: none;
    }

    .btn, .footer {
        display: none;
    }
}

/* Success Modal Styles */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: var(--card-padding);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    color: var(--secondary-color);
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-body {
    padding: var(--card-padding);
    text-align: center;
}

.success-icon {
    font-size: clamp(2.5rem, 5vw, 3rem);
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.success-message h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: clamp(1.1rem, 1.5vw, 1.25rem);
}

.app-id {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1rem 0;
    font-size: clamp(0.9rem, 1vw, 1rem);
    border: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: var(--card-padding);
    display: flex;
    justify-content: center;
    gap: 1rem;
}

@media (max-width: 576px) {
    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Modal Responsive Styles */
.modal-dialog {
    margin: 1rem;
    max-width: 100%;
}

.modal-content {
    border-radius: var(--border-radius);
    border: none;
}

.modal-header,
.modal-body,
.modal-footer {
    padding: 1rem;
}

@media (min-width: 576px) {
    .modal-dialog {
        margin: 1.75rem auto;
        max-width: 500px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.5rem;
    }
}

/* Responsive Breakpoints */
@media (min-width: 992px) {
    :root {
        --container-padding: 2.5rem;
        --card-padding: 2.5rem;
        --form-spacing: 2rem;
        --input-height: 50px;
    }

    body {
        font-size: 16px;
    }

    .container {
        max-width: 960px;
    }

    .card {
        margin: 2rem auto;
    }

    .form-title {
        font-size: 2rem;
    }

    .logo {
        height: 50px;
    }

    .form-control, .form-select {
        font-size: 1rem;
    }

    .declaration-text {
        font-size: 14px;
    }

    .footer {
        font-size: 14px;
    }
}

@media (max-width: 991px) {
    .container {
        padding: 75px 15px 15px;
    }

    .card {
        padding: 25px;
        margin: 20px 0;
    }

    .form-title {
        font-size: 24px;
        margin: 20px 0 30px;
    }
}

@media (max-width: 768px) {
    .container {
        padding-top: 70px;
    }
    
    .card {
        padding: 20px;
        margin: 15px 0;
    }

    .form-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .date-fields {
        text-align: center;
        width: 100%;
    }

    .form-title {
        font-size: 22px;
        margin: 15px 0 25px;
    }

    .row {
        margin: -8px;
        width: calc(100% + 16px);
    }

    .col-md-4, .col-md-6, .col-md-8, .col-12 {
        padding: 8px;
    }

    .form-control, .form-select {
        height: 42px;
        font-size: 14px;
    }

    .gender-group {
        gap: 20px;
        justify-content: center;
    }

    .declaration-text {
        font-size: 13px;
        padding: 15px;
        margin: 25px 0;
    }

    .submit-section {
        flex-direction: column;
    }

    .submit-section .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .container {
        padding-top: 65px;
    }
    
    .card {
        padding: 15px;
        margin: 10px 0;
    }

    .logo {
        max-height: 50px;
    }

    .form-title {
        font-size: 20px;
    }

    .form-label {
        font-size: 14px;
    }

    .form-control, .form-select {
        height: 40px;
        padding: 8px 12px;
    }

    .gender-group {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .form-check-input {
        width: 16px;
        height: 16px;
    }

    .footer {
        margin-top: 20px;
        padding-top: 15px;
    }

    .footer p {
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .container {
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        padding: 0;
    }

    .print-section {
        padding: 20px;
    }

    .print-header {
        margin-bottom: 20px;
    }

    .print-header img {
        max-height: 50px;
    }

    .form-data {
        margin-top: 20px;
    }

    .form-field {
        margin-bottom: 10px;
        display: flex;
        gap: 10px;
    }

    .form-field label {
        font-weight: bold;
        min-width: 150px;
    }
}

/* Custom Popup Responsive Styles */
.custom-popup {
    padding: 10px 15px;
    flex-wrap: wrap;
    gap: 10px;
    text-align: center;
}

@media (max-width: 575px) {
    .custom-popup {
        flex-direction: column;
    }

    .custom-popup .ok-button {
        width: 100%;
        padding: 8px;
    }
}

.date-field {
    border-bottom: 1px solid #000;
    min-width: 150px;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    padding: 10px 30px;
}

.btn-primary:hover {
    background-color: #003d82;
}

.date-fields span {
    font-weight: 500;
    color: #1A3C6E;
}

.submit-section {
    margin-top: 30px;
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.submit-btn:hover {
    background: darken(var(--primary-color), 10%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 183, 100, 0.2);
    color: var(--primary-color) !important;
}

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #eef0f2;
    padding: 20px;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1A3C6E;
}

.success-icon {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 20px;
}

.success-message h4 {
    color: #1A3C6E;
    margin-bottom: 15px;
}

.app-id {
    margin-top: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.app-id strong {
    color: #1A3C6E;
}

.modal-footer {
    border-top: 1px solid #eef0f2;
    padding: 20px;
}

.modal-footer .btn {
    padding: 8px 24px;
    border-radius: 6px;
}

#printApplication {
    background: #1A3C6E;
    border: none;
}

#printApplication:hover {
    background: #142f54;
}

@media print {
    body * {
        visibility: hidden;
    }
    .print-section, .print-section * {
        visibility: visible;
    }
    .print-section {
        position: absolute;
        left: 0;
        top: 0;
    }
}

/* Custom Popup Styles */
.custom-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--secondary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    animation: slideDown var(--transition-speed) ease;
}

.custom-popup .ok-button {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 5px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.custom-popup .ok-button:hover {
    background: darken(var(--primary-color), 5%);
    transform: translateY(-1px);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Form styles */
.form-container {
    margin-top: 20px;
}

/* Authentication Check */
.auth-check {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.auth-spinner {
    width: 3rem;
    height: 3rem;
    color: var(--primary-color);
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .form-title {
        font-size: 1.75rem;
    }

    .card {
        padding: 1.5rem;
    }

    .form-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

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

@media (max-width: 767.98px) {
    .container {
        padding: 1rem;
    }

    .form-title {
        font-size: 1.5rem;
    }

    .gender-group {
        gap: 1rem;
    }

    .declaration-text {
        font-size: 0.9rem;
        padding: 1rem;
    }

    .submit-section {
        flex-direction: column;
    }

    .submit-section .btn {
        width: 100%;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .card {
        padding: 1rem;
        border-radius: 15px;
    }

    .form-header .logo {
        height: 40px;
    }

    .form-title {
        font-size: 1.25rem;
    }

    .form-control, .form-select {
        font-size: 0.95rem;
    }

    .footer {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .footer p {
        font-size: 0.8rem;
    }
}

/* Date input specific styles */
input[type="date"] {
    appearance: none;
    padding-right: 0.5rem;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.7;
    cursor: pointer;
}

/* Select specific styles */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Info icon styles */
.form-label i {
    color: var(--primary-color);
    margin-left: 0.25rem;
    font-size: 0.9rem;
}

.btn-new-admission {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.btn-new-admission i {
    font-size: 1.25rem;
}

.btn-new-admission:hover {
    background-color: #009e54;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 183, 100, 0.25);
}

@media (max-width: 768px) {
    .btn-new-admission {
        bottom: 1.5rem;
        right: 1.5rem;
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .btn-new-admission {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1rem;
    }
} 