/* Overlay style */
.overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999;
}

/* Overlay closing cross */
.overlay .overlay-close {
    width: 40px;
    height: 40px;
    position: absolute;
    right: 20px;
    top: 20px;
    overflow: hidden;
    border: none;
    outline: none;
    z-index: 100;
    color: #fff;
    background: #0F1035;
}

/* Menu style */
.overlay nav {
    text-align: center;
    position: relative;
    top: 50%;
    height: 60%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
}

.overlay ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: inline-block;
    height: 100%;
    position: relative;
}

.overlay ul li {
    display: block;
    height: 20%;
    height: calc(100% / 5);
    min-height: 54px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.overlay ul li a {
    font-size: 20px;
    letter-spacing: 6px;
    font-weight: 300;
    display: block;
    color: #fff;
    -webkit-transition: color 0.2s;
    transition: color 0.2s;
    text-decoration: none;
}

.overlay ul li a:hover,
.overlay ul li a:focus {
    color: #3f51b5;
}

/* Effects */
.overlay-simplegenie {
    visibility: hidden;
    -webkit-transform: translateY(60%) scale(0);
    transform: translateY(60%) scale(0);
    -webkit-transition: -webkit-transform 0.4s, visibility 0s 0.4s;
    transition: transform 0.4s, visibility 0s 0.4s;
}

.overlay-simplegenie.open {
    visibility: visible;
    -webkit-transform: translateY(0%) scale(1);
    transform: translateY(0%) scale(1);
    -webkit-transition: -webkit-transform 0.4s;
    transition: transform 0.4s;
}

/* Variables */
:root {
    --ios-bg-primary: rgba(255, 255, 255, 0.9);
    --ios-bg-secondary: rgba(255, 255, 255, 0.8);
    --ios-blur: blur(15px);
    --ios-border: rgba(255, 255, 255, 0.3);
    --ios-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --ios-text-primary: #2d3748;
    --ios-text-secondary: #4a5568;
    --ios-blue: #007AFF;
    --ios-light-blue: #5AC8FA;
    --ios-gray: #8E8E93;
    --ios-light-gray: #C7C7CC;
    --ios-background: #F2F2F7;
}

/* Background gradient seperti di logout.php */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Poppins", sans-serif;
    background: linear-gradient(135deg, #8ec5fc, #e0c3fc) !important;
    background-attachment: fixed;
    padding-top: 80px;
    animation: fadeIn 1.2s ease-in-out;
    color: var(--ios-text-primary);
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

/* iOS Style Header - FIXED POSITIONING ISSUE */
.header-w3ls {
    position: fixed;
    top: 30px;
    left: 0;
    right: 0;
    z-index: 9999;
    width: 100%;
    background: var(--ios-bg-primary);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    color: var(--ios-text-primary);
    animation: slideDown 0.8s ease-out;
    box-shadow: var(--ios-shadow);
    border-bottom: 1px solid var(--ios-border);
    padding: 12px 15px;
}

/* iOS Style Buttons - Sesuaikan dengan background baru */
.ios-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    transition: all 0.2s ease;
    background: var(--ios-bg-secondary);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    color: var(--ios-text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    text-decoration: none;
}

.ios-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: var(--ios-text-primary);
}

.ios-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ios-btn i {
    margin-right: 6px;
}

.btn-danger {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.btn-success {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.btn-warning {
    background: rgba(255, 193, 7, 0.9);
    color: white;
}

.btn-primary {
    background: rgba(0, 123, 255, 0.9);
    color: white;
}

.btn-secondary {
    background: rgba(108, 117, 125, 0.9);
    color: white;
}

.btn-info {
    background: rgba(23, 162, 184, 0.9);
    color: white;
}

/* iOS Style Modal */
.modal-content {
    border-radius: 14px;
    background: var(--ios-bg-primary);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--ios-border);
    color: var(--ios-text-primary);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    border-bottom: 1px solid var(--ios-border);
    padding: 16px 20px;
    flex-shrink: 0;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    border-top: 1px solid var(--ios-border);
    padding: 15px 20px;
    flex-direction: column;
    flex-shrink: 0;
}

.modal-title {
    font-weight: 600;
    color: var(--ios-text-primary);
    margin: 0;
    margin-top: 10px;
    text-align: center;
    width: 100%;
}

/* iOS Style Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 500;
    color: var(--ios-text-primary);
    margin-bottom: 8px;
}

.form-control {
    border-radius: 10px;
    padding: 12px 16px;
    background: var(--ios-bg-secondary);
    border: 1px solid var(--ios-border);
    color: var(--ios-text-primary);
    transition: all 0.2s ease;
}

.form-control:focus {
    background: var(--ios-bg-secondary);
    border-color: rgba(0, 122, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
    outline: none;
}

.input-group-text {
    background: var(--ios-bg-secondary);
    border: 1px solid var(--ios-border);
    color: var(--ios-text-secondary);
    border-radius: 0 10px 10px 0;
    background-color: #f8f9fa;
    border-right: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes subtleBounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

/* iOS Style Captcha */
.captcha-container {
    border-radius: 10px;
    overflow: hidden;
    background: var(--ios-bg-secondary);
    border: 1px solid var(--ios-border);
    margin-bottom: 10px;
}

#captcha-code,
#register-captcha-code,
#forgot-captcha-code {
    background: var(--ios-bg-secondary);
    border: none;
    text-align: center;
    font-weight: bold;
    letter-spacing: 3px;
    color: var(--ios-text-primary);
    cursor: default;
    background-color: #f8f9fa;
    font-size: 18px;
    color: #333;
}

/* Status Bar Simulation (iOS style) - FIXED POSITIONING */
.ios-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: var(--ios-bg-primary);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--ios-border);
}

.ios-status-time {
    font-weight: 600;
    font-size: 14px;
    color: var(--ios-text-primary);
}

/* Home Indicator (for mobile) */
.ios-home-indicator {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background: var(--ios-text-primary);
    border-radius: 3px;
    opacity: 0.6;
    z-index: 9998;
}

/* Content spacing for iOS */
.ios-content {
    margin-top: 20px;
    padding: 0 16px;
    position: relative;
    text-align: center;
}

/* iOS style alerts */
.swal2-popup {
    border-radius: 14px !important;
    background: var(--ios-bg-primary) !important;
    backdrop-filter: var(--ios-blur) !important;
    -webkit-backdrop-filter: var(--ios-blur) !important;
    color: var(--ios-text-primary) !important;
    border: 1px solid var(--ios-border) !important;
}

/* Logo styling */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    animation: subtleBounce 2s infinite;
    position: relative;
    z-index: 10;
    text-align: center;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.logo-container img {
    max-width: 60%;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

.logo-container::before {
    content: "";
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    z-index: -1;
}

/* Title styling */
.ios-title {
    font-weight: 700;
    font-size: 24px;
    text-align: center;
    color: var(--ios-text-primary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.ios-title span {
    font-weight: 800;
}

.text-center p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.footer-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Status messages */
.status-message {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
    text-align: center;
}

.success {
    background-color: #d4edda;
    color: #155724;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Scrollbar styling */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive adjustments - MOBILE VIEW */
@media (max-width: 768px) {
    /* Header di bagian bawah untuk mobile */
    .header-w3ls {
        top: auto;
        bottom: 0;
        border-top: 1px solid var(--ios-border);
        border-bottom: none;
        padding: 8px 5px;
        animation: slideUp 0.8s ease-out;
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    /* Menyesuaikan padding body untuk header bawah */
    body {
        padding-top: 20px;
        padding-bottom: 60px; /* Ruang untuk header di bawah */
    }

    .header-w3ls .d-flex {
        display: none !important; /* Sembunyikan layout desktop */
    }

    /* Tombol berjajar horizontal untuk mobile */
    .mobile-button-container {
        display: flex;
        justify-content: space-around;
        width: 100%;
    }

    .ios-btn {
        flex-direction: column;
        padding: 8px 10px;
        font-size: 12px;
        min-width: 60px;
    }

    .ios-btn span {
        display: block;
        font-size: 10px;
        margin-top: 4px;
    }

    .ios-btn i {
        margin-right: 0;
        font-size: 18px;
        margin-bottom: 2px;
    }

    .logo-container img {
        max-width: 80%;
    }

    .ios-status-bar {
        height: 25px; /* Smaller on mobile */
    }

    .ios-status-time {
        font-size: 13px;
    }
}

/* Desktop view */
@media (min-width: 769px) {
    .mobile-button-container {
        display: none !important; /* Sembunyikan tombol mobile di desktop */
    }

    .header-w3ls .d-flex {
        display: flex !important; /* Tampilkan layout desktop */
    }
}

@media (min-width: 576px) {
    .footer-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .footer-buttons button,
    .footer-buttons a {
        flex: 1;
        max-width: 200px;
    }
}

@media screen and (max-height: 30.5em) {
    .overlay nav {
        height: 70%;
        font-size: 34px;
    }
    .overlay ul li {
        min-height: 34px;
    }
}