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

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow: hidden;
}

/* Top Navigation Bar */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border-bottom: 2px solid #67150a;
    padding: 50px 24px;
    height: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #67150a;
}

.logo-placeholder {
    margin-left: 55px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.navbar-brand svg {
    color: #67150a;
}

.navbar-user {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #333;
}

.user-info:hover {
    background: #67150a;
    color: white;
    border-color: #67150a;
}

.user-info:hover svg {
    stroke: white;
}

.user-info svg {
    color: #67150a;
    transition: all 0.3s ease;
}

.dropdown-icon {
    transition: transform 0.3s ease;
}

.user-info.active .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.header-section {
    padding: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    scroll-padding-bottom: 10px;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
}

.dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

.dropdown-item:hover {
    background: #f8f8f8;
    color: #67150a;
}

.dropdown-item:hover svg {
    stroke: #67150a;
}

.dropdown-item svg {
    color: #666;
    transition: all 0.2s ease;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

.container {
    display: flex;
    height: calc(100vh - 60px);
}

/* Sidebar - 25% */
.sidebar {
    width: 25%;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px;
}

.header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    margin-top: 10px;
}

.header svg {
    color: #67150a;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #67150a;
}

/* (rest of content retained) */
/* ================================================
   REGISTRATION FORM STYLES - Radio Buttons
   ================================================ */

/* User Type Radio Options */
.user-type-options,
.stream-options,
.level-options {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-option,
.college-radio {
    position: relative;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    /* Reset accent-color so native radio doesn't take the brand color */
    accent-color: initial;
}

.radio-option label {
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
}

.radio-option input[type="radio"]:checked+label {
    font-weight: 600;
    color: #67150a;
}

/* Form Group Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: #67150a;
    box-shadow: 0 0 0 3px rgba(103, 21, 10, 0.1);
}

.form-group select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Required Field Indicator */
.required {
    color: #d32f2f;
    font-weight: 600;
}

/* Hidden class for dynamic show/hide */
.hidden {
    display: none !important;
}

/* Alert Box for Registration */
#alertBox .alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

#alertBox .alert-success {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

#alertBox .alert-error {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Registration Container Specific Styles */
.register-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.register-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 900px;
    padding: 40px;
}

/* Form grid for wider registration layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.form-grid .form-group {
    margin-bottom: 0;
}

.col-span-2 {
    grid-column: 1 / -1;
}

/* Ensure student and staff field wrappers don't break the grid layout */
#studentFields {
    display: contents;
}

/* Make it responsive */
@media (max-width: 900px) {
    .register-card {
        max-width: 700px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .col-span-2 {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .register-card {
        padding: 30px 16px;
    }
}

.register-header {
    text-align: center;
    margin-bottom: 30px;
}

.register-header h1 {
    font-size: 28px;
    color: #67150a;
    margin-bottom: 8px;
}

.register-header p {
    color: #666;
    font-size: 14px;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 12px;
    background: #67150a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #4a0f07;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(103, 21, 10, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Generic Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    background: #67150a;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #67150a;
    color: #ffffff;
}

.btn-primary:hover {
    background: #4a0f07;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(103, 21, 10, 0.2);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #efefef;
}

.btn-block {
    width: 100%;
    display: inline-flex;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(103, 21, 10, 0.12);
}

/* Login Link */
.login-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.login-link a {
    color: #67150a;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

/* College radio/selection styles removed: registration is now student-only (MCC). */

/* Responsive Design */
@media (max-width: 768px) {
    .register-card {
        padding: 30px 20px;
    }

    .user-type-options,
    .stream-options,
    .level-options {
        flex-direction: column;
        gap: 10px;
    }
}

/* ================================================
   LOGIN & REGISTRATION PAGE STYLES
   ================================================ */

/* Login Wrapper */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(103, 21, 10, 0.5);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

/* Login logo styling */
.login-logo {
    width: 380px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    padding-bottom: 20px;
    border-radius: 10px;
    border-color: #ffffff;
    border-style: solid;
    border-width: 1px;
}

.login-logo-admin {

    width: 380px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    /* padding-bottom: 20px; */
    /* border-radius: 10px; */
    border-bottom: 1px solid #ffffff;

}

@media (max-width: 480px) {
    .login-logo {
        width: 120px;
        max-width: 80%;
    }
}

.login-card .header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgb(103, 21, 10);
}

.subtitle {
    font-size: 13px;
    color: #666;
    margin: 4px 0 0 0;
}

.login-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

/* Force login button to use primary styles and full width */
.login-card .login-actions .btn {
    width: 100%;
    min-width: 0;
    flex: 1 1 0;
    padding: 12px 14px;
    font-size: 16px;
    background: #67150a;
    color: #fff;
    border: none;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-card .login-actions .btn:hover {
    background: #4a0f07;
}

.login-card .login-actions button {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

/* Strong override if other styles override .btn */
.login-card .login-actions button[type="submit"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
    padding: 12px 18px !important;
    font-size: 16px !important;
    background: #67150a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Registration Page Styles */
.register-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    overflow-y: auto;
}

.register-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 900px;
    padding: 40px;
    margin: 20px 0;
}

.register-header {
    text-align: center;
    margin-bottom: 30px;
}

.register-header h1 {
    font-size: 28px;
    color: #67150a;
    margin-bottom: 8px;
}

.register-header p {
    color: #666;
    font-size: 14px;
}

/* User Type & Stream/Level Radio Options */
.user-type-options,
.stream-options,
.level-options {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* Radio option styling - label wraps input */
.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    font-size: 14px;
    color: #333;
    user-select: none;
}

/* Hide native radio controls */
.radio-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ccc;
    cursor: pointer;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    position: relative;
}

/* Selected state - show inner dot */
.radio-option input[type="radio"]:checked {
    background: #fff;
    border: 2px solid #67150a;
    box-shadow: inset 0 0 0 3px #67150a;
}

/* When selected, make the label text bold and primary colored */
.radio-option:has(input[type="radio"]:checked) {
    color: #67150a;
    font-weight: 600;
}

/* Focus state */
.radio-option input[type="radio"]:focus {
    outline: 2px solid rgba(103, 21, 10, 0.3);
    outline-offset: 2px;
}

/* Form Group Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:not([type="radio"]):not([type="checkbox"]):focus,
.form-group select:focus {
    outline: none;
    border-color: #67150a;
    box-shadow: 0 0 0 3px rgba(103, 21, 10, 0.1);
}

.form-group select {
    cursor: pointer;
}

.form-group select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Required Field Indicator */
.required {
    color: #d32f2f;
    font-weight: 600;
}

/* Hidden class for dynamic show/hide */
.hidden {
    display: none !important;
}

/* Alert Box for Registration */
#alertBox .alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

#alertBox .alert-success {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

#alertBox .alert-error {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 12px;
    background: #67150a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #4a0f07;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(103, 21, 10, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Login Link */
.login-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.login-link a {
    color: #67150a;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h3 {
    margin: 0;
    flex: 1;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {

    .register-card,
    .login-card {
        padding: 30px 20px;
    }

    .user-type-options,
    .stream-options,
    .level-options {
        flex-direction: column;
        gap: 10px;
    }

    .register-header h1 {
        font-size: 24px;
    }
}

/* Fix body overflow for login/register pages */
body:has(.login-wrapper),
body:has(.register-container) {
    overflow: auto;
}

/* ================================================
   CANVAS AREA STYLES
   ================================================ */

/* Canvas Area - 75% */
.canvas-area {
    width: 75%;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.canvas-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.canvas-header svg {
    color: #67150a;
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background: #f5f5f5;
    border-color: #67150a;
}

.zoom-btn:hover svg {
    color: #67150a;
}

.zoom-btn svg {
    color: #666;
}

.zoom-level {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 50px;
    text-align: center;
}

.zoom-divider {
    width: 1px;
    height: 24px;
    background: #e0e0e0;
}

.template-upload {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    overflow: auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Certificate Canvas */
#certificateCanvas {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: crosshair;
    transform-origin: center center;
    transition: transform 0.2s ease;
}

/* Form Section */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #67150a;
    box-shadow: 0 0 0 3px rgba(103, 21, 10, 0.1);
}

/* Divider */
.divider {
    height: 1px;
    background: #e0e0e0;
    margin: 20px 0;
}

/* Bulk Data Section */
.bulk-data-section {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.bulk-data-section.compact {
    padding: 12px;
}

/* Instructions Section */
.instructions-section {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.file-name {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Compact controls used in sidebar (replaces large Canvas Controls block) */
.controls-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-btn {
    padding: 8px 12px;
    font-size: 13px;
}

/* Bulk data buttons container */
.bulk-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.bulk-buttons .btn {
    padding: 6px 10px;
    font-size: 13px;
}

.bulk-buttons .excel-name {
    font-size: 12px;
    color: #444;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-basis: 100%;
    margin-top: 6px;
}

.bulk-buttons .generate-btn {
    padding: 8px 12px;
    font-size: 13px;
    margin-left: auto;
}

/* Help modal overrides */
#helpModal .modal-content {
    max-width: 520px;
}

#helpModal .modal-body {
    font-size: 13px;
    color: #444;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 40vh;
    }

    .canvas-area {
        width: 100%;
    }
}