/* ============================================
   MAIN.CSS - Shared Styles
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #003362;
    min-height: 100vh;
    padding: 20px;
}

/* ============================================
   CONTAINERS & LAYOUT
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1 {
    color: #212020;
    margin-bottom: 10px;
    font-size: 32px;
}

h2 {
    color: #212020;
    margin-bottom: 20px;
    font-size: 24px;
}

h3 {
    color: #212020;
    margin-bottom: 15px;
}

.subtitle {
    color: #212020;
    margin-bottom: 30px;
}

/* ============================================
   BUTTONS
   ============================================ */

button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn {
    width: 100%;
    padding: 14px;
    background: #003362;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #00254a;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    flex: 1;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #212020;
    font-weight: 500;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #003362;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #003362;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-bar {
    height: 100%;
    background: #003362;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

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

/* ============================================
   LOGO
   ============================================ */

.auth-logo {
    width: 220px;
    margin: 0 auto 28px;
    display: block;
    object-fit: contain;
}

/* ============================================
   SITE NAVIGATION
   ============================================ */

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 4px;
}

.nav-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 40px;
    object-fit: contain;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2px;
    flex: 1;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

/* Nav dropdown (Support menu) */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    background: #00284d;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    padding: 6px;
    z-index: 1000;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

@media (hover: hover) {
    .nav-dropdown:hover .nav-dropdown-menu {
        display: block;
    }
}

.nav-dropdown-menu a {
    display: block;
    padding: 9px 14px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-user .user-email {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 768px) {
    .site-nav {
        flex-wrap: wrap;
    }
    .nav-links {
        order: 3;
        flex-wrap: wrap;
    }
    .nav-user {
        margin-left: auto;
    }
    .nav-user .user-email {
        display: none;
    }
}

/* ============================================
   DELETE MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal h3 {
    margin-bottom: 12px;
    color: #333;
}

.modal p {
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 20px;
    font-size: 15px;
    border-radius: 8px;
    font-weight: 600;
}

.modal-actions .btn-cancel {
    background: #e0e0e0;
    color: #333;
    border: none;
    cursor: pointer;
}

.modal-actions .btn-cancel:hover {
    background: #d0d0d0;
}

.modal-actions .btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    width: auto;
    padding: 10px 20px;
    font-size: 15px;
}

.modal-actions .btn-danger:hover {
    background: #c82333;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #28a745;
    color: white;
    padding: 14px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    transform: translateY(0);
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast.toast-hide {
    opacity: 0;
    transform: translateY(20px);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .card {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
}
