﻿/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    /*background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;*/
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    
}

    .menu-toggle:hover {
        background-color: rgba(255,255,255,0.1);
    }

.header-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.main-title {
    font-size: 18px;
    font-weight: 600;
}

.sub-title {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 300;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1100;
    transition: left 0.3s ease;
    overflow-y: auto;
}

    .sidebar.active {
        left: 0;
    }

/* Menu toggle button in sidebar */
.menu-toggle2 {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    z-index: 10;
}

    .menu-toggle2:hover {
        background: rgba(255,255,255,0.2);
    }

.sidebar-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 10px 20px;
    text-align: center;
    position: relative;
    padding-left: 60px; /* Make room for close button */
}

    .sidebar-header h2 {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .sidebar-header p {
        font-size: 12px;
        opacity: 0.9;
    }

.sidebar-menu {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 10px;
}

/*.menu-section-title {
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
    background: #e8e8e8;
}*/

.menu-section-title {
    padding: 12px 20px 8px 20px;
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #f7fafc 0%, #edf2f7 100%);
    position: relative;
    /*border-left: 4px solid #2a5298;*/
    margin-left: 0;
    margin-right: 0;
}

    .menu-section-title::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 20px;
        width: 30px;
        height: 2px;
        background: #2a5298;
    }

.menu-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

    .menu-item:hover {
        background-color: #f8f9fa;
        border-left-color: #2a5298;
    }

    .menu-item.active {
        background-color: #e3f2fd;
        border-left-color: #2a5298;
        color: #1976d2;
        font-weight: 500;
    }

.menu-item-en {
    font-size: 14px;
    display: inline;
    margin: 0;
}

.menu-item-cn {
    font-size: 12px;
    opacity: 0.7;
    display: inline;
    margin: 0;
    white-space: nowrap;
}

.menu-separator {
    border-top: 1px solid #eee;
    margin: 10px 0;
}

/* Main Content */
.main-content {
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

.page {
    display: none;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px;
}

    .page.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e3f2fd;
}

.page-title-en {
    font-size: 24px;
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 5px;
}

.page-title-cn {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

/* Overlay for sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
    }

    .main-title {
        font-size: 16px;
    }

    .sub-title {
        font-size: 12px;
    }

    .main-content {
        padding: 15px;
    }

    .page {
        padding: 15px;
    }

    .page-title-en {
        font-size: 20px;
    }

    .page-title-cn {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        left: -100%;
    }

    .main-content {
        padding: 10px;
    }

    .page {
        padding: 15px;
        margin-bottom: 15px;
    }
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #2a5298;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    margin: 5px;
}

    .btn:hover {
        background: #1e3c72;
        transform: translateY(-1px);
    }

.btn-secondary {
    background: #6c757d;
}

    .btn-secondary:hover {
        background: #545b62;
    }

.btn-success {
    background: #28a745;
}

    .btn-success:hover {
        background: #218838;
    }

.btn-danger {
    background: #dc3545;
}

    .btn-danger:hover {
        background: #c82333;
    }

.btn-small {
    padding: 8px 15px;
    font-size: 12px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.2s;
}

    .form-control:focus {
        outline: none;
        border-color: #2a5298;
        box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.1);
    }

/* Message Box Styles - Extending your existing basic_css.css */
.sp-message-container {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    max-width: 500px;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.sp-message-show {
    top: 80px; /* Adjusted for fixed header */
    opacity: 1;
}

.sp-message-success {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.sp-message-error {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}

.sp-message-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
    color: inherit;
}

.sp-message-text {
    font-size: 14px;
    color: inherit;
}

/* Dialog Action Box - Extending your existing basic_css.css */
.sp-dialog-container {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    max-width: 500px;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease-in-out;
    background-color: #eef6fa;
    border: 1px solid #b3cde0;
}

.sp-dialog-show {
    top: 80px; /* Adjusted for fixed header */
    opacity: 1;
}

.sp-dialog-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
    color: #035b96;
}

.sp-dialog-text {
    font-size: 14px;
    margin-bottom: 15px;
    color: #033e66;
}

.sp-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.sp-dialog-button {
    padding: 5px 15px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.sp-dialog-yes {
    background-color: #cce5ff;
    border: 1px solid #b3cde0;
    color: #004085;
}

    .sp-dialog-yes:hover {
        background-color: #b3d7ff;
    }

.sp-dialog-no {
    background-color: #e6f3ff;
    border: 1px solid #cce5ff;
    color: #033e66;
}

    .sp-dialog-no:hover {
        background-color: #cce5ff;
    }

/* Big Loading Animation - Extending your existing basic_css.css */
#bigLoadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loadingSpinner {
    width: 150px;
    height: 150px;
    border: 10px solid #fff;
    border-top: 10px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
