/* Admin Page Styles */
@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@400;500;600;700;800&display=swap');

:root {
    --admin-primary: #0f172a;
    --admin-secondary: #3b82f6;
    --admin-bg: #f1f5f9;
    --admin-text: #334155;
    --admin-light: #ffffff;
    --admin-border: #e2e8f0;
    --admin-danger: #ef4444;
}

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

body {
    font-family: 'Pretendard', sans-serif;
    background-color: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.6;
}

/* -------------------------------------
   LOGIN SCREEN
----------------------------------------*/
#loginScreen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--admin-primary), #1e293b);
}

.login-box {
    background: var(--admin-light);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h2 {
    color: var(--admin-primary);
    margin-bottom: 24px;
    font-size: 1.5rem;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.login-form input:focus {
    border-color: var(--admin-secondary);
}

.login-form button {
    width: 100%;
    padding: 14px;
    background-color: var(--admin-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-form button:hover {
    background-color: #2563eb;
}

.login-error {
    color: var(--admin-danger);
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: none;
}

/* -------------------------------------
   DASHBOARD SCREEN
----------------------------------------*/
#dashboardScreen {
    display: none; /* Hidden by default until login */
    min-height: 100vh;
}

.admin-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background-color: var(--admin-primary);
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.sidebar-menu-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}


.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

/* 스크롤바 스타일링 (선택사항, 웹킷 브라우저용) */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05); 
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3); 
}

.sidebar-nav a {
    display: block;
    padding: 16px 24px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background-color: rgba(255,255,255,0.05);
    color: white;
    border-left-color: var(--admin-secondary);
}

.sidebar-nav a i {
    width: 24px;
    margin-right: 8px;
}

.sidebar-footer {
    padding: 20px;
    text-align: center;
}

.logout-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

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

/* Main Content */
.admin-main {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.8rem;
    color: var(--admin-primary);
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--admin-light);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--admin-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-right: 16px;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-info .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--admin-primary);
}

/* Data Table (Quote Requests) */
.data-section {
    background: var(--admin-light);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 24px;
}

.data-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.data-section-header h2 {
    font-size: 1.2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-table td {
    color: #334155;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-new {
    background-color: #fef2f2;
    color: #ef4444;
}

.status-done {
    background-color: #f0fdf4;
    color: #22c55e;
}

/* -------------------------------------
   MOBILE RESPONSIVENESS
----------------------------------------*/
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        flex-shrink: 0;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .mobile-menu-btn {
        display: block !important;
    }
    
    .sidebar-menu-content {
        display: none;
    }
    
    .sidebar-menu-content.open {
        display: block;
    }
    
    .sidebar-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px;
    }
    
    .sidebar-nav a {
        padding: 12px 8px;
        font-size: 0.9rem;
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: 8px;
    }

    .sidebar-nav a i {
        margin-right: 0;
        font-size: 1.2rem;
    }
    
    .sidebar-nav a:hover, .sidebar-nav a.active {
        border-left-color: transparent;
        border-bottom-color: var(--admin-secondary);
        background-color: rgba(255,255,255,0.05);
    }
    
    .sidebar-nav a[href="index.html"] {
        grid-column: 1 / -1;
        flex-direction: row;
        margin-top: 8px !important;
    }

    .sidebar-nav a[href="index.html"] i {
        margin-right: 8px;
    }
    
    .sidebar-footer {
        padding: 12px;
    }
    
    .admin-main {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .page-header h1 {
        font-size: 1.4rem;
    }
    
    .data-section {
        padding: 12px;
    }
    
    /* Convert table to card layout for mobile */
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
        display: block;
        width: 100%;
        white-space: normal;
    }
    
    .admin-table thead {
        display: none; /* Hide column headers */
    }
    
    .admin-table tr {
        margin-bottom: 16px;
        background: #ffffff;
        border: 1px solid var(--admin-border);
        border-radius: 8px;
        padding: 16px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }
    
    .admin-table td {
        border-bottom: none;
        padding: 6px 0;
        text-align: left;
    }
    
    /* Give some visual hierarchy to the card fields */
    .admin-table td:nth-child(1) { /* Name */
        font-size: 1.1rem;
        display: inline-block;
        margin-right: 10px;
    }
    .admin-table td:nth-child(2) { /* Phone */
        display: inline-block;
        color: #64748b;
        font-size: 0.9rem;
    }
    .admin-table td:nth-child(4) { /* Date */
        font-size: 0.85rem;
        color: #94a3b8;
        float: right;
        margin-top: -30px;
    }
    .admin-table td:nth-child(5) { /* Status */
        margin-top: -30px;
        float: right;
        margin-right: 70px;
    }
    .admin-table td:nth-child(3) { /* Message */
        clear: both;
        padding: 10px 0;
        border-top: 1px solid #f1f5f9;
        margin-top: 8px;
    }
    
    /* Actions Row */
    .admin-table td:last-child {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px dashed var(--admin-border);
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        justify-content: flex-end;
    }
    
    .login-box {
        padding: 24px;
        margin: 16px;
    }
}
