
/* ==========================================================================
   PhillypDraw - 통합 스타일시트
   ========================================================================== */
/* --------------------------------------------------------------------------
   공통 스타일
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    background: #f5f5f5;
}

/* --------------------------------------------------------------------------
   폼 공통 스타일
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: #333;
    font-weight: bold;
    font-size: 12px;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* --------------------------------------------------------------------------
   버튼 스타일
   -------------------------------------------------------------------------- */
.btn {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-group .btn {
    flex: 1;
}

/* --------------------------------------------------------------------------
   알림 메시지
   -------------------------------------------------------------------------- */
.alert {
    padding: 10px 12px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 12px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #e7f3ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* --------------------------------------------------------------------------
   로그인 페이지 스타일
   -------------------------------------------------------------------------- */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.auth-header h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 10px;
}

.auth-header p {
    color: #666;
    font-size: 14px;
}

.auth-header p.warning {
    color: #e74c3c;
    font-size: 13px;
}

.btn-auth {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-auth:hover {
    background: #5568d3;
}

/* --------------------------------------------------------------------------
   헤더 스타일
   -------------------------------------------------------------------------- */
.header {
    background: #2c3e50;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left h1 {
    font-size: 18px;
    margin-right: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    font-size: 12px;
}

.user-name {
    font-weight: bold;
    color: #3498db;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
}

.user-name:hover {
    color: #5dade2;
    text-decoration: underline;
}

.user-role {
    color: #95a5a6;
    font-size: 11px;
    margin-left: 5px;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c0392b;
}

/* --------------------------------------------------------------------------
   사이드바 스타일
   -------------------------------------------------------------------------- */
.layout-container {
    display: flex !important;
    min-height: calc(100vh - 48px);
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Bootstrap과의 충돌 방지 - 레이아웃 컨테이너는 flex 유지 */
body > .layout-container {
    display: flex !important;
    flex-direction: row !important;
}

.sidebar {
    width: 180px;
    min-width: 180px;
    flex-shrink: 0;
    background: #34495e;
    color: white;
    padding: 15px 0;
}

.menu-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
    border-left: 3px solid transparent;
    color: white;
    text-decoration: none;
    display: block;
}

.menu-item:hover {
    background: #2c3e50;
    border-left-color: #3498db;
}

.menu-item.active {
    background: #2c3e50;
    border-left-color: #3498db;
}

.menu-divider {
    height: 1px;
    background: #2c3e50;
    margin: 8px 15px;
}

/* --------------------------------------------------------------------------
   메인 컨텐츠 영역
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

.content-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.content-header h2 {
    font-size: 18px;
    color: #2c3e50;
}

.content-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

/* --------------------------------------------------------------------------
   환영 섹션 (대시보드)
   -------------------------------------------------------------------------- */
.welcome-section {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.welcome-section h2 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 15px;
}

.welcome-section p {
    color: #7f8c8d;
    font-size: 16px;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   통계 카드 그리드
   -------------------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.stat-card h3 {
    color: #95a5a6;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: normal;
}

.stat-card .number {
    color: #2c3e50;
    font-size: 32px;
    font-weight: bold;
}

/* --------------------------------------------------------------------------
   테이블 스타일
   -------------------------------------------------------------------------- */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: #f8f9fa;
}

table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: bold;
    font-size: 12px;
    color: #2c3e50;
    border-bottom: 2px solid #ddd;
}

table td {
    padding: 6px 10px;
    font-size: 12px;
    border-bottom: 1px solid #eee;
}

table tbody tr:hover {
    background: #f8f9fa;
}

/* --------------------------------------------------------------------------
   유틸리티 클래스
   -------------------------------------------------------------------------- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* --------------------------------------------------------------------------
   햄버거 메뉴 버튼
   -------------------------------------------------------------------------- */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 15px;
    z-index: 1001;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* 사이드바 오버레이 배경 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* --------------------------------------------------------------------------
   반응형 디자인
   -------------------------------------------------------------------------- */
/* 태블릿 및 모바일 (768px 이하) */
@media (max-width: 768px) {
    /* 햄버거 버튼 표시 */
    .hamburger-btn {
        display: flex;
    }

    /* 헤더 조정 */
    .header {
        padding: 10px 15px;
    }

    .header-left h1 {
        font-size: 16px;
    }

    .user-info {
        font-size: 11px;
    }

    .user-role {
        display: none;
    }

    .btn-logout {
        padding: 5px 10px;
        font-size: 10px;
    }

    /* 레이아웃 컨테이너 */
    .layout-container {
        flex-direction: row !important;
    }

    /* 사이드바를 오버레이로 변경 */
    .sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        min-width: 250px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding-top: 60px;
    }

    .sidebar.active {
        left: 0;
    }

    /* 메인 콘텐츠 전체 너비 사용 */
    .main-content {
        width: 100%;
        padding: 15px;
        margin-left: 0;
    }

    /* 인증 페이지 */
    .auth-container {
        padding: 30px 20px;
    }

    /* 통계 그리드 */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* 테이블 스크롤 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }
}

/* 매우 작은 화면 (480px 이하) */
@media (max-width: 480px) {
    .header-left h1 {
        font-size: 14px;
    }

    .user-name {
        font-size: 11px;
    }

    .sidebar {
        width: 220px;
        min-width: 220px;
        left: -220px;
    }

    .main-content {
        padding: 10px;
    }

    .content-header h2 {
        font-size: 16px;
    }

    .welcome-section {
        padding: 25px;
    }

    .welcome-section h2 {
        font-size: 22px;
    }
}