/* Solomon Islands Scholarship Application - Custom Styles */

/* ===== CUSTOM POPUP SYSTEM ===== */
.custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.3s ease;
}

.custom-popup-overlay.show {
    display: flex;
}

.custom-popup {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 320px;
    width: 320px;
    min-height: 280px;
    max-height: 400px;
    overflow-y: auto;
    animation: slideInPopup 0.3s ease;
    position: relative;
    aspect-ratio: 1.1;
}

.custom-popup-header {
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-direction: column;
    text-align: center;
}

.custom-popup-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-bottom: 0.25rem;
}

.custom-popup-icon.confirm {
    background: #fff3cd;
    color: #856404;
}

.custom-popup-icon.alert {
    background: #f8d7da;
    color: #721c24;
}

.custom-popup-icon.success {
    background: #d1edff;
    color: #0c5460;
}

.custom-popup-icon.info {
    background: #cce7ff;
    color: #055160;
}

.custom-popup-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #212529;
    text-align: center;
}

.custom-popup-body {
    padding: 0.75rem 1rem;
    text-align: center;
}

.custom-popup-message {
    color: #495057;
    line-height: 1.4;
    margin: 0;
    white-space: pre-line;
    font-size: 0.9rem;
}

.custom-popup-input {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    transition: border-color 0.3s ease;
}

.custom-popup-input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.custom-popup-footer {
    padding: 0.75rem 1rem 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.custom-popup-btn {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
    flex: 1;
    max-width: 120px;
}

.custom-popup-btn-primary {
    background: #0d6efd;
    color: white;
}

.custom-popup-btn-primary:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
}

.custom-popup-btn-danger {
    background: #dc3545;
    color: white;
}

.custom-popup-btn-danger:hover {
    background: #bb2d3b;
    transform: translateY(-1px);
}

.custom-popup-btn-secondary {
    background: #6c757d;
    color: white;
}

.custom-popup-btn-secondary:hover {
    background: #5c636a;
    transform: translateY(-1px);
}

.custom-popup-btn-outline {
    background: transparent;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.custom-popup-btn-outline:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInPopup {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive adjustments for small square popup */
@media (max-width: 480px) {
    .custom-popup {
        max-width: 280px;
        width: 280px;
        min-height: 250px;
        margin: 1rem;
    }

    .custom-popup-header {
        padding: 0.75rem 0.75rem 0.5rem;
    }

    .custom-popup-body {
        padding: 0.5rem 0.75rem;
    }

    .custom-popup-footer {
        padding: 0.5rem 0.75rem 0.75rem;
        gap: 0.4rem;
    }

    .custom-popup-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: 60px;
    }

    .custom-popup-message {
        font-size: 0.85rem;
    }

    .custom-popup-title {
        font-size: 1rem;
    }
}

/* Root Variables - PNG Higher Education Program Color Palette */
:root {
    --primary-color: #2c3e50;        /* Dark Blue-Grey (from hero section) */
    --primary-gradient-start: #2c3e50; /* Hero gradient start */
    --primary-gradient-end: #34495e;   /* Hero gradient end */
    --secondary-color: #dc3545;      /* Red (action buttons) */
    --warning-color: #ffc107;        /* Yellow/Gold (highlights) */
    --success-color: #28a745;        /* Green (success states) */
    --info-color: #17a2b8;           /* Blue (info states) */
    --danger-color: #dc3545;         /* Red (danger/delete) */
    --dark-color: #212529;           /* Black */
    --light-color: #f8f9fa;          /* Light Grey */
    --medium-grey: #495057;          /* Medium Dark Grey */
    --light-grey: #e9ecef;           /* Very Light Grey */
    --accent-color: #6c757d;         /* Medium Grey */
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;

    /* PNG Program specific colors */
    --hero-bg: linear-gradient(135deg, rgba(44, 62, 80, 0.9), rgba(52, 73, 94, 0.9));
    --navbar-bg: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

/* Navigation Styles */
.navbar {
    background: var(--navbar-bg) !important;
    box-shadow: var(--box-shadow);
}

.navbar-brand {
    font-weight: 600;
    color: white !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.navbar-nav .nav-link.active {
    color: var(--warning-color) !important;
    font-weight: 600;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius);
}

.dropdown-item:hover {
    background-color: var(--light-grey);
    color: var(--primary-color);
}

/* Header Styles */
header {
    background: var(--navbar-bg) !important;
    box-shadow: var(--box-shadow);
}

.department-header {
    background: var(--navbar-bg);
    border-bottom: 2px solid var(--danger-color);
}

.flag-img {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: var(--navbar-bg) !important;
    color: white;
    border-bottom: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    font-weight: 600;
}

.card-header .card-title {
    color: white;
    margin-bottom: 0;
}

.card-title {
    color: var(--primary-color);
    font-weight: 600;
}

/* Form Styles */
.form-step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-valid, .form-select.is-valid {
    border-color: var(--secondary-color);
}

/* Form Check Styles */
.form-check {
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-check:hover {
    background-color: rgba(220, 53, 69, 0.05);
}

.form-check-input {
    margin-top: 0.25rem;
}

.form-check-input:checked {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Button Styles */
.btn {
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--navbar-bg);
    box-shadow: 0 2px 4px rgba(44, 62, 80, 0.3);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-gradient-end), var(--primary-gradient-start));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(44, 62, 80, 0.4);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    border: none;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
    color: white;
}

.btn-success {
    background: var(--success-color);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    border: none;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    border: none;
    color: var(--dark-color);
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.4);
    color: var(--dark-color);
}

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

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #4e555b;
    transform: translateY(-2px);
}

/* Progress Bar */
.progress {
    background-color: var(--light-grey);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.6s ease;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.alert-success {
    border-left-color: var(--secondary-color);
    background-color: rgba(40, 167, 69, 0.1);
}

.alert-info {
    border-left-color: #17a2b8;
    background-color: rgba(23, 162, 184, 0.1);
}

/* Step Headers */
.form-step h4 {
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* Checkbox and Radio Groups */
.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Invalid Feedback */
.invalid-feedback {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .form-step h4 {
        font-size: 1.25rem;
    }
    
    .col-md-4, .col-md-6 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        margin: 0.5rem;
    }
    
    .form-control, .form-select {
        padding: 0.5rem 0.75rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
    }
    
    #prevBtn, #nextBtn, #submitBtn {
        width: 100%;
        margin: 0.25rem 0;
    }
}

/* Print Styles */
@media print {
    .btn, .progress, header, footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .form-step {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* Accessibility */
.form-control:focus,
.form-select:focus,
.btn:focus,
.form-check-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control, .form-select {
        border-width: 3px;
    }
    
    .btn {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== PASSWORD CHANGE PAGE STYLES ===== */
.password-page-body {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.95), rgba(52, 73, 94, 0.95)),
                url('../assets/hero-bg.jpg') center/cover fixed;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 20px 0;
    position: relative;
}

.password-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    max-width: 500px;
    margin: 0 auto;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.password-header {
    background: var(--navbar-bg);
    color: white;
    position: relative;
    overflow: hidden;
}

.password-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.logo-circle:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.password-form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
}

.password-form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(44, 62, 80, 0.15);
    background: white;
    transform: translateY(-1px);
}

.password-input-group .btn {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border: 2px solid #e9ecef;
    border-left: none;
    transition: var(--transition);
}

.password-input-group .password-form-control:focus + .btn {
    border-color: var(--primary-color);
}

.password-btn-primary {
    background: var(--navbar-bg);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    color: white;
    position: relative;
    overflow: hidden;
}

.password-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.password-btn-primary:hover::before {
    left: 100%;
}

.password-btn-primary:hover {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.3);
    color: white;
}

.password-strength {
    height: 8px;
    border-radius: 4px;
    transition: all 0.4s ease;
    background-color: #e9ecef;
    position: relative;
    overflow: hidden;
}

.password-alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.5s ease-out;
}

.password-alert-info {
    border-left-color: var(--info-color);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(52, 152, 219, 0.05));
}

.password-alert-danger {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(231, 76, 60, 0.05));
}

.password-alert-success {
    border-left-color: var(--success-color);
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(39, 174, 96, 0.05));
}

.password-form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.security-tips {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1), rgba(243, 156, 18, 0.05));
    border-radius: var(--border-radius);
    border-left: 4px solid var(--warning-color);
    backdrop-filter: blur(10px);
}

.student-info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(52, 152, 219, 0.05));
    border-radius: var(--border-radius);
    border: 1px solid rgba(52, 152, 219, 0.2);
    backdrop-filter: blur(10px);
}

/* Loading animation */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading .password-btn-primary {
    position: relative;
}

.loading .password-btn-primary::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Password page mobile responsive styles */
@media (max-width: 768px) {
    .main-container {
        padding: 15px;
        align-items: flex-start;
        padding-top: 30px;
    }

    .password-card {
        margin: 0;
        border-radius: var(--border-radius);
    }

    .password-card .card-body {
        padding: 1.5rem;
    }

    .password-header {
        padding: 2rem 1.5rem;
    }

    .logo-circle {
        width: 70px;
        height: 70px;
    }

    .password-btn-primary {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .password-form-control {
        padding: 0.75rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 10px;
        padding-top: 20px;
    }

    .password-card .card-body {
        padding: 1rem;
    }

    .password-header {
        padding: 1.5rem 1rem;
    }

    .logo-circle {
        width: 60px;
        height: 60px;
    }
}

/* Global mobile responsiveness improvements */
@media (max-width: 768px) {
    /* Table responsiveness */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Button groups on mobile */
    .btn-group-sm .btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Card adjustments */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Form controls */
    input.form-control,
    select.form-select,
    textarea.form-control {
        font-size: 16px;
    }
    
    /* Navbar adjustments */
    .navbar-nav {
        padding: 0.5rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        max-width: 90vw;
    }
    
    /* Custom popup mobile adjustments */
    .custom-popup {
        max-width: 90vw;
        width: 90vw;
        margin: 1rem;
    }
    
    /* Container padding */
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 576px) {
    /* Smaller screens */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Button text wrapping */
    .btn {
        white-space: normal;
        word-wrap: break-word;
    }
    
    /* Stats cards */
    .col-md-3 {
        margin-bottom: 1rem;
    }
}
