/* 전역 스타일 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

/* 대시보드 레이아웃 */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* 사이드바 스타일 */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    box-sizing: border-box;
}

.profile-info {
    margin-bottom: 20px;
    text-align: center;
}

.logout-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #c0392b;
}

.band-selection {
    margin-bottom: 20px;
    width: 100%;
}

#bandSelect {
    width: 100%;
    padding: 10px;
    background-color: #34495e;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#bandSelect:hover {
    background-color: #2980b9;
}

#bandSelect:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.5);
}

/* 모바일 환경에서의 스타일 */
@media (max-width: 768px) {
    .band-selection {
        margin-bottom: 15px;
    }

    #bandSelect {
        padding: 12px;
        font-size: 16px;
    }
}

/* 옵션 스타일링 (브라우저 지원 여부에 따라 다를 수 있음) */
#bandSelect option {
    background-color: white;
    color: #333;
}

/* 화살표 아이콘 커스터마이징 (브라우저 지원 여부에 따라 다를 수 있음) */
#bandSelect {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.sidebar nav ul {
    list-style-type: none;
    padding: 0;
}

.sidebar nav ul li {
    margin-bottom: 15px;
}

.sidebar nav ul li a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.sidebar nav ul li a:hover {
    background-color: #34495e;
}

.sidebar nav ul li a.active {
    background-color: #3498db;
}

/* 메인 콘텐츠 영역 */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #ecf0f1;
    border-bottom: 1px solid #ddd;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left h1 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.header-right .brand-logo {
    height: 25px;
    width: auto;
    object-fit: contain;
}

/* 서브메뉴 스타일 */
.submenu {
    background-color: #f8f9fa;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
}

.top-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.menu-buttons, .date-range-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.top-menu button, #dateRangePicker, #applyDateRange {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

.top-menu button:hover, #applyDateRange:hover {
    background-color: #2980b9;
}

.top-menu button.active, .date-range-selector button.active {
    background-color: #2c3e50;
}

#dateRangePicker {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    color: #333;
}

/* 콘텐츠 영역 */
#content-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.graph-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 20px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

canvas {
    width: 100% !important;
    height: auto !important;
    min-height: 300px;
}

/* 테이블 스타일 */

table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
    white-space: nowrap;
}

th {
    background-color: #f2f2f2;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn:focus, .btn:active {
    outline: none;
    box-shadow: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-success:hover, .btn-success:focus, .btn-success:active,
.btn-warning:hover, .btn-warning:focus, .btn-warning:active,
.btn-danger:hover, .btn-danger:focus, .btn-danger:active,
.btn-info:hover, .btn-info:focus, .btn-info:active {
    filter: brightness(90%);
}

@media (max-width: 768px) {
    #content-area table td {
        text-decoration: none !important;
        color: inherit !important;
        -webkit-text-fill-color: inherit !important;
    }

    #content-area table td a {
        text-decoration: none !important;
        color: inherit !important;
        -webkit-text-fill-color: inherit !important;
    }
}

/* 특정 열에 대한 추가 스타일 */
#content-area table td:first-child,
#content-area table td:nth-child(2),
#content-area table td:last-child {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* 테이블 내의 모든 링크에 대한 스타일 */
#content-area table a,
#content-area table a:hover,
#content-area table a:visited,
#content-area table a:active {
    text-decoration: none !important;
    border-bottom: none !important;
    color: inherit !important;
}

/* 테이블 내 버튼 스타일 */
#content-area table .btn {
    pointer-events: auto;
    user-select: none;
    cursor: pointer;
}

#content-area table .btn-primary {
    background-color: #007bff;
    color: white;
}

#content-area table .btn-success {
    background-color: #28a745;
    color: white;
}

#content-area table .btn-warning {
    background-color: #ffc107;
    color: black;
}

#content-area table .btn-danger {
    background-color: #dc3545;
    color: white;
}

#content-area table .btn-info {
    background-color: #17a2b8;
    color: white;
}

/* 모바일 반응형 스타일 */
.mobile-only {
    display: none;
}

#mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: #2c3e50;
    cursor: pointer;
    padding: 0;
    margin-right: 15px;
}

#close-sidebar {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* 인증(로그인/회원가입) 폼 스타일 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f4f4f4;
}

.auth-form-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-form-container h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.auth-form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #34495e;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.auth-form .form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.auth-form .btn-primary {
    width: 100%;
    padding: 0.75rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.auth-form .btn-primary:hover {
    background-color: #2980b9;
}

.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links a {
    color: #3498db;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100%;
        width: 250px;
        transition: left 0.3s ease-in-out;
        z-index: 1000;
    }

    .sidebar.active {
        left: 0;
    }

    .content {
        width: 100%;
    }

    .main-header {
        padding: 10px;
    }

    .header-left h1 {
        font-size: 20px;
    }

    .submenu {
        padding: 10px;
    }

    .top-menu button, #dateRangePicker, #applyDateRange {
        padding: 8px;
        font-size: 12px;
    }

    #content-area {
        padding: 10px;
    }

    .graph-container {
        padding: 10px;
    }

    canvas {
        min-height: 200px;
    }

    .mobile-only {
        display: block;
    }

    .auth-form-container {
        padding: 1rem;
    }

    table {
        min-width: 300px;
    }

    /* 모바일 환경에서의 추가 스타일 */
    #content-area table {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    #content-area table td,
    #content-area table th {
        -webkit-user-select: none;
        user-select: none;
    }
}

.error-popup {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s;
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.remember-me input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.remember-me label {
    font-size: 16px;
}

/* 계정정보 페이지 스타일 */
.account-info-table {
    width: 100%;
    border-collapse: collapse;
}

.account-info-table th,
.account-info-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.account-info-table th {
    width: 30%;
    color: #333;
    font-weight: bold;
}

.account-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

.account-actions .btn {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
}

.account-actions .btn-primary {
    background-color: #3498db;
    color: white;
}

.account-actions .btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.admin-viewing-message {
    background-color: #ffeb3b;
    color: #000;
    text-align: center;
    padding: 10px;
    font-weight: bold;
}

.admin-viewing-message a {
    color: #1976d2;
    text-decoration: none;
}

.admin-viewing-message a:hover {
    text-decoration: underline;
}

.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.loading-spinner:after {
    content: " ";
    display: block;
    width: 64px;
    height: 64px;
    margin: 8px;
    border-radius: 50%;
    border: 6px solid #3498db;
    border-color: #3498db transparent #3498db transparent;
    animation: loading-spinner 0.4s linear infinite;
}

@keyframes loading-spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* payment_status 테이블 스타일 */
#paymentTable {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#paymentTable th,
#paymentTable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#paymentTable th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #333;
}

#paymentTable tr:last-child td {
    border-bottom: none;
}

#paymentTable tr:hover {
    background-color: #f5f5f5;
}

@media screen and (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    .mobile-only {
        display: inline-block;
    }
}

@media screen and (min-width: 769px) {
    .desktop-only {
        display: inline-block;
    }
    .mobile-only {
        display: none;
    }
}

/* Add these styles to style.css */

.ad-balance-container {
    padding: 0 20px;
}

#adBalanceTable {
    width: 100%;
    border-collapse: collapse;
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#adBalanceTable th,
#adBalanceTable td {
    padding: 15px;
    text-align: center;
    border: 1px solid #ddd;
}

#adBalanceTable th {
    background-color: #e9ecef;
    font-weight: bold;
    color: #495057;
}

#adBalanceTable td {
    font-size: 1.2em;
}

/* 모바일 미디어 쿼리 내부에 동일한 스타일 추가 */
@media (max-width: 768px) {
    .ad-balance-container {
        padding: 0 10px; /* 모바일에서는 패딩을 좀 더 줄일 수 있습니다 */
    }

    #adBalanceTable {
        width: 100%;
        border-collapse: collapse;
        background-color: #f8f9fa;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    #adBalanceTable th,
    #adBalanceTable td {
        padding: 10px; /* 모바일에서는 패딩을 좀 더 줄일 수 있습니다 */
        text-align: center;
        border: 1px solid #ddd;
    }

    #adBalanceTable th {
        background-color: #e9ecef;
        font-weight: bold;
        color: #495057;
    }

    #adBalanceTable td {
        font-size: 1em; /* 모바일에서는 폰트 크기를 조금 줄일 수 있습니다 */
    }
}