/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header nav {
    display: flex;
    gap: 1rem;
}

.pc-nav {
    display: flex;
}

.btn-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 25px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.btn-hamburger span {
    width: 100%;
    height: 2px;
    background-color: white;
    border-radius: 10px;
    transition: all 0.3s linear;
}

header nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

header nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

header nav a.btn-logout {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 모바일 드로어 */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.mobile-drawer-overlay.active {
    display: block;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background-color: white;
    z-index: 1001;
    transition: right 0.3s ease-in-out;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-drawer.open {
    right: 0;
}

.drawer-header {
    background-color: #f8f9fa;
    padding: 2rem 1.5rem;
    position: relative;
    border-bottom: 1px solid #eee;
}

.btn-close-drawer {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile .avatar {
    width: 50px;
    height: 50px;
    background-color: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
}

.user-profile .info {
    display: flex;
    flex-direction: column;
}

.user-profile .user-email {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.user-profile .view-profile,
.user-profile .login-link {
    font-size: 0.85rem;
    color: #3498db;
    text-decoration: none;
    margin-top: 5px;
}

.mobile-nav {
    padding: 1rem 0;
}

.mobile-nav ul {
    list-style: none;
}

.mobile-nav li a {
    display: block;
    padding: 1rem 1.5rem;
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.05rem;
    border-bottom: 1px solid #f8f9fa;
}

.mobile-nav li a:hover {
    background-color: #f8f9fa;
}

.nav-divider {
    height: 1px;
    background-color: #eee;
    margin: 0.5rem 0;
}

body.no-scroll {
    overflow: hidden;
}

/* 메인 컨텐츠 */
main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* 검색 섹션 */
.search-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-search-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input-group {
    flex: 1;
}

.search-input-group input {
    width: 100%;
    padding: 0.85rem;
    border: 2px solid #3498db;
    border-radius: 8px;
    font-size: 1.1rem;
}

.btn-search-main {
    padding: 0.85rem 2rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-filter-toggle {
    padding: 0.85rem 1.5rem;
    background-color: #f8f9fa;
    color: #2c3e50;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter-toggle:hover {
    background-color: #e9ecef;
}

.btn-filter-toggle.active {
    background-color: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.advanced-filter-section {
    background: #f8fbff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e3f2fd;
    margin-top: 0.5rem;
}

.source-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.source-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #444;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* 정렬 헤더 */
.bid-table th a {
    color: #bdc3c7;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    transition: color 0.2s;
}

.bid-table th a:hover {
    color: white;
    text-decoration: underline;
}

.bid-table th a.active-sort {
    color: #f1c40f;
    font-weight: bold;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group small {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

/* 버튼 */
.btn,
button[type="submit"] {
    padding: 0.75rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

.btn:hover,
button[type="submit"]:hover {
    background-color: #2980b9;
}

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

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background-color: #95a5a6;
}

.btn-small:hover {
    background-color: #7f8c8d;
}

.btn-favorite {
    background-color: #f39c12;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-favorite:hover {
    background-color: #e67e22;
}

.btn-favorite.active {
    background-color: #e74c3c;
}

/* 테이블 */
.bid-list {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.list-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.list-header h2 {
    font-size: 1.5rem;
    color: #2c3e50;
}

.bid-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.bid-table th {
    background-color: #34495e;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.bid-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.bid-table tr:hover {
    background-color: #f8f9fa;
}

.bid-table .title-cell a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.bid-table .title-cell a:hover {
    text-decoration: underline;
}

.bid-table .amount {
    text-align: right;
    font-weight: 500;
    color: #27ae60;
}

.award-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #27ae60;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.text-center {
    text-align: center;
}

/* 상세 페이지 */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.detail-header h2 {
    font-size: 1.75rem;
    color: #2c3e50;
    margin: 0;
}

.detail-content {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 1.25rem;
    color: #34495e;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

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

.detail-table th {
    background-color: #ecf0f1;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    width: 200px;
    vertical-align: top;
}

.detail-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.detail-text {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.detail-text h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #34495e;
}

.detail-text h4:first-child {
    margin-top: 0;
}

.detail-text p {
    white-space: pre-wrap;
    line-height: 1.8;
}

.detail-actions {
    text-align: center;
    padding: 2rem 0;
}

/* 인증 폼 */
.auth-form-container {
    max-width: 500px;
    margin: 3rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

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

.auth-form button[type="submit"] {
    width: 100%;
    margin-top: 1rem;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

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

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

/* 알림 */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 페이징 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    background-color: white;
    color: #3498db;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination a.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 관리자 대시보드 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.stat-text {
    font-size: 1.25rem;
    color: #2c3e50;
    margin: 0;
}

.admin-actions {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.admin-actions h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.admin-actions .btn {
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

.help-text {
    margin-top: 1rem;
    color: #7f8c8d;
    font-size: 0.875rem;
}

.admin-info {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-info h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.admin-info code {
    display: block;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
}

/* 푸터 */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 3rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-links {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

.footer-links .divider {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.copyright {
    color: #95a5a6;
    font-size: 0.85rem;
    margin: 0;
}

/* 반응형 */
@media (max-width: 768px) {
    header .container {
        flex-direction: row;
        /* 로고와 햄버거 버튼 가로 배치 */
        justify-content: space-between;
        gap: 0;
    }

    .pc-nav {
        display: none;
    }

    .btn-hamburger {
        display: flex;
    }

    .main-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-search-main,
    .btn-filter-toggle {
        width: 100%;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .source-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .bid-table {
        font-size: 0.8125rem;
    }

    .bid-table th:nth-child(1),
    .bid-table td:nth-child(1),
    .bid-table th:nth-child(5),
    .bid-table td:nth-child(5),
    .bid-table th:nth-child(6),
    .bid-table td:nth-child(6),
    .bid-table th:nth-child(8),
    .bid-table td:nth-child(8),
    .bid-table th:nth-child(9),
    .bid-table td:nth-child(9) {
        display: none;
    }

    .bid-table th,
    .bid-table td {
        padding: 0.5rem 0.25rem;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .detail-table {
        font-size: 0.875rem;
    }

    .detail-table th {
        width: 120px;
    }
}


/* 첨부파일 스타일 */
.attachment-list {
    background-color: #fcfcfc;
    border: 1px solid #eee;
    padding: 1rem;
    border-radius: 8px;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-list li {
    margin-bottom: 0.75rem;
}

.file-list li:last-child {
    margin-bottom: 0;
}

.download-link {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background-color: #f1f3f5;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid #dee2e6;
}

.download-link:hover {
    background-color: #e9ecef;
    color: #212529;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.no-data {
    color: #888;
    font-style: italic;
}

.text-link {
    color: #3498db;
    text-decoration: none;
}


.text-link:hover {
    text-decoration: underline;
}

/* AI 추천 섹션 (테이블 형태) */
.ai-recommendation-section {
    margin-bottom: 2.5rem;
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #e3f2fd;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.ai-header {
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.ai-header h3 {
    font-size: 1.3rem;
    color: #1976d2;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-header p {
    font-size: 0.95rem;
    color: #78909c;
}

.ai-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.ai-table th {
    background: #f8fbff;
    color: #546e7a;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #e3f2fd;
}

.ai-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f1f1;
    vertical-align: middle;
}

.ai-source-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.75rem;
}

.ai-title-link {
    display: block;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 4px;
}

.ai-title-link:hover {
    color: #1976d2;
    text-decoration: underline;
}

.ai-reason-text {
    font-size: 0.85rem;
    color: #607d8b;
    background: #fdfdfd;
    padding: 4px 8px;
    border-left: 3px solid #64b5f6;
    margin-top: 4px;
}

.text-center {
    text-align: center;
}

@media (max-width: 768px) {
    .ai-table thead {
        display: none;
    }

    .ai-table tr {
        display: block;
        margin-bottom: 1rem;
        background: #fafafa;
        border-radius: 8px;
        padding: 5px;
    }

    .ai-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        border: none;
    }

    .ai-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #90a4ae;
        font-size: 0.8rem;
    }

    .ai-table .title-cell {
        display: block;
    }

    .ai-table .amount {
        color: #e53935;
        font-weight: bold;
    }
}