/* 기본 레이아웃 */
body {
    font-family: 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
}

.container {
    width: 80%;
    margin: auto;
    padding: 20px;
}

/* 네비게이션 바 */
.navbar {
    background-color: #333;
    overflow: hidden;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 15px;
    margin-left: auto;
}

.nav-links li {
    display: inline-block;
}

.nav-links a {
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    transition: background 0.3s;
}

.nav-links a:hover {
    background-color: #575757;
}

/* 로고 스타일 */
.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

/* 버튼 스타일 */
button, .btn, .btn-action {
    background-color: #4CAF50;
    color: white;
    padding: 10px 18px;
    border: none;
    cursor: pointer;
    border-radius: 6px; /* 둥글게 */
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

button:hover, .btn:hover, .btn-action:hover {
    background-color: #45a049;
}

.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.button-group {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 20px;
}

/* 테이블 스타일 */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

table th, table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
    font-size: 15px;
}

table th {
    background-color: #f4f4f4;
    font-weight: bold;
    color: #333;
    width: 150px;
}

table tbody tr:hover {
    background-color: #f9f9f9;
    cursor: pointer;
}

table img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.image-cell {
    width: 100px;
    height: 100px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-group .image-cell {
    width: 100%;
    height: auto;
}

.form-group img {
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100%;
    height: auto;
}

/* 상품 등록/수정/삭제 버튼 */
.btn.register-btn {
    display: inline-block;
    margin-top: 30px;
    margin-right: 10px;
    float: right;
}

.btn-action {
    background-color: #2196F3;
    margin-right: 5px;
}

.btn-delete {
    background-color: #f44336;
}

/* 로딩 스피너 */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.product-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.product-buttons form {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 공통 폼 스타일 */
.form-wrapper {
    max-width: 400px;
    margin: 50px auto;
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.form-wrapper button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: 1px solid #4CAF50;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-sizing: border-box;
}

.form-wrapper button[type="submit"]:hover {
    background-color: #45a049;
}

/* 테스트 로그인 링크/버튼 */
.register-link .button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: space-between;
}

.register-link .btn {
    text-align: center;
    font-weight: 500;
    width: 200px;
    padding: 10px 0;
    border: 2px solid #4CAF50;
    border-radius: 6px;
}

.register-link .btn:hover {
    background-color: #2196F3;
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    transform: translateY(-2px);
}

.highlight {
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
}

/* 주문 통계 */
.order-stats {
    display: flex;
    justify-content: center;
    text-align: center;
    margin: 30px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.order-stats .stat-box {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    font-size: 16px;
    font-weight: 500;
}

.order-stats .stat-box strong {
    font-size: 20px;
    color: #4CAF50;
    margin-left: 6px;
}

.order-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid transparent;
    min-width: 90px;
    text-align: center;
}

/* 주문 상태별 색상 */
.order-status.pending {
    background-color: #f0f0f0;
    color: #777;
    border-color: #ccc;
}

.order-status.completed {
    background-color: #e6f4ea;
    color: #2e7d32;
    border-color: #a5d6a7;
}

.order-status.canceled {
    background-color: #fdecea;
    color: #c62828;
    border-color: #f5c6cb;
}

.product-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    max-height: 250px;
}

.product-grid {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background-color: #f0f0f0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    scroll-behavior: smooth;
}

.product-grid::-webkit-scrollbar {
    height: 12px;
}

.product-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.product-grid::-webkit-scrollbar-thumb {
    background-color: #cccccc;
    border: 2px solid #f0f0f0;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.product-grid::-webkit-scrollbar-thumb:hover {
    background-color: #c02762;
}

.product-card {
    width: 200px;
    flex-shrink: 0;
}

.product-card h3 {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.product-card p {
    text-align: right;
}

.section-title {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(90deg, #ff8a00, #e52e71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    margin: 30px 0 20px 0;
    position: relative;
}
