/* 
 * Stylesheet utama untuk aplikasi 2FA
 * Fokus pada design responsive dan mobile-first
 */

:root {
    --app-primary-color: #3b71ca;
    --app-secondary-color: #6c757d;
    --app-success-color: #14a44d;
    --app-danger-color: #dc4c64;
    --app-warning-color: #e4a11b;
    --app-info-color: #54b4d3;
    --app-light-color: #f9f9f9;
    --app-dark-color: #1f1f1f;
    --app-border-radius: 0.5rem;
    --app-box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: var(--app-dark-color);
    background-color: #f5f5f5;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Auth Pages (Login, etc) */
.auth-page {
    background-color: var(--app-light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
}

.auth-page .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.auth-page .card {
    position: relative;
    z-index: 10;
    border: none;
    border-radius: var(--app-border-radius);
    box-shadow: var(--app-box-shadow);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.auth-page .card-body {
    padding: 2.5rem;
}

@media (max-width: 576px) {
    .auth-page .card-body {
        padding: 1.5rem;
    }
}

.auth-page .card-header {
    background-color: var(--app-primary-color);
    color: white;
    padding: 1.25rem;
    border-bottom: none;
}

.auth-page .auth-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto 1rem;
}

.auth-page .auth-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-page .auth-subtitle {
    color: #777;
    margin-bottom: 1.5rem;
}

/* Form Controls */
.form-floating {
    margin-bottom: 1.5rem;
}

.form-control {
    border-radius: var(--app-border-radius);
    padding: 0.75rem 1rem;
    height: auto;
    border: 1px solid #ddd;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: var(--app-primary-color);
    box-shadow: 0 0 0 0.25rem rgba(59, 113, 202, 0.15);
}

.btn {
    border-radius: var(--app-border-radius);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--app-primary-color);
    border-color: var(--app-primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #2f5aa9;
    border-color: #2f5aa9;
}

.input-group .input-group-text {
    background-color: transparent;
    border-right: none;
    padding-right: 0;
}

.input-group .form-control {
    border-left: none;
}

.input-group:focus-within .input-group-text {
    border-color: var(--app-primary-color);
}

/* Cards & Containers */
.card {
    border: none;
    border-radius: var(--app-border-radius);
    box-shadow: var(--app-box-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem 1.5rem;
}

/* OTP Display */
.otp-container {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.otp-container::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, transparent 50%, rgba(13, 110, 253, 0.1) 50%);
    border-radius: 0 8px 0 0;
    z-index: 1;
}

.otp-code {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-align: center;
    color: #495057;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

/* Highlight effect when OTP is regenerated */
.otp-code.regenerated {
    animation: highlight 2s;
}

@keyframes highlight {
    0% { background-color: rgba(13, 110, 253, 0.2); }
    100% { background-color: transparent; }
}

/* Efek hover pada OTP code */
.otp-code:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Efek saat OTP code diklik */
.otp-code:active {
    transform: translateY(0);
    background-color: #dee2e6;
}

/* Efek saat OTP code disalin */
.otp-code.copied {
    background-color: rgba(40, 167, 69, 0.2);
    animation: flash 0.5s;
}

/* Tambahkan visual cue bahwa kode OTP dapat diklik */
.otp-code::after {
    content: "Tap untuk menyalin";
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: #6c757d;
    margin-top: 4px;
    opacity: 0.7;
}

/* Tambahkan ikon clipboard kecil di sudut kanan atas */
.otp-code::before {
    content: "\F4CB"; /* Bootstrap Icons clipboard code */
    font-family: "bootstrap-icons";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
    opacity: 0.5;
    color: #6c757d;
}

.otp-code:hover::before {
    opacity: 1;
    color: #0d6efd;
}

/* Animasi flash ketika kode disalin */
@keyframes flash {
    0% { background-color: rgba(40, 167, 69, 0.2); }
    50% { background-color: rgba(40, 167, 69, 0.5); }
    100% { background-color: rgba(40, 167, 69, 0.2); }
}

.otp-timer {
    margin-top: 10px;
}

.progress {
    height: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    background-color: #0d6efd;
    transition: width 1s linear;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header, .card-body, .card-footer {
        padding: 1rem;
    }
    
    .otp-code {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        margin-bottom: 0;
    }
}

/* Navbar Responsive */
.navbar-brand {
    font-weight: 700;
}

.navbar-nav .nav-link {
    padding: 0.75rem 1rem;
}

@media (max-width: 992px) {
    .navbar-nav .nav-link {
        padding: 0.5rem 0;
    }
    
    .navbar .dropdown-menu {
        padding: 0.5rem 0;
        margin-left: 1rem;
        border: none;
        background-color: transparent;
        box-shadow: none;
    }
}

/* Settings Page */
.settings-card {
    margin-bottom: 1.5rem;
}

.settings-card .form-label {
    font-weight: 500;
}

.image-preview {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: var(--app-border-radius);
    margin-top: 0.5rem;
    border: 1px solid #ddd;
    padding: 3px;
    background-color: #fff;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body.dark-mode-enabled {
        background-color: #1a1a1a;
        color: #f1f1f1;
    }
    
    .dark-mode-enabled .card,
    .dark-mode-enabled .btn-light,
    .dark-mode-enabled .form-control,
    .dark-mode-enabled .input-group-text {
        background-color: #2a2a2a;
        border-color: #444;
        color: #f1f1f1;
    }
    
    .dark-mode-enabled .text-muted {
        color: #bbb !important;
    }
    
    .dark-mode-enabled .form-control:focus {
        background-color: #333;
    }
    
    .dark-mode-enabled .otp-container {
        background-color: #2a2a2a;
    }
    
    .dark-mode-enabled .otp-code {
        color: #f1f1f1;
    }
}

/* Custom Switch for Dark Mode */
.dark-mode-switch {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.dark-mode-switch .form-check-input {
    height: 24px;
    width: 48px;
    cursor: pointer;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem 0;
    color: #6c757d;
    font-size: 0.875rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-top: 2rem;
}

/* Komponen Tambahan */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #6c757d;
    font-weight: 600;
    margin-right: 10px;
} 