/* Reset & Common Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

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

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #3498db;
    cursor: pointer;
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 0.8;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    transition: color 0.3s;
}

nav a:hover {
    color: #3498db;
}

/* Form Styles */
.form-container {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
    width: 100%;
    padding: 12px;
    font-weight: 500;
}

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

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

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

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

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

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.card-meta {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.card-content {
    margin-bottom: 15px;
    color: #555;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Team Badge */
.team-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    background-color: #3498db;
    color: white;
    transition: all 0.3s ease;
}

.team-badge:hover {
    background-color: #2980b9;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* Search & Filter */
.search-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.search-row input[type="date"],
.search-row input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-label {
    font-weight: 500;
    color: #333;
    min-width: 80px;
}

.search-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.date-quick-buttons {
    display: flex;
    gap: 5px;
}

.date-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.date-btn:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
}

.date-btn:active {
    background-color: #3498db;
    color: white;
}

.search-btn-custom {
    width: auto !important;
    padding: 8px 24px !important;
}

/* Toggle View Link */
.toggle-view-link {
    cursor: pointer;
    font-size: 1.1rem;
    color: #555;
    display: inline-flex;
    align-items: center;
}

.toggle-view-link .toggle-text {
    color: #555;
    transition: color 0.3s;
}

.toggle-view-link:hover .toggle-text {
    color: #3498db;
}

/* Filter and Sort Container */
.filter-sort-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

/* Sort Buttons */
.sort-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-btn {
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.sort-btn:hover {
    color: #3498db;
}

.sort-btn.active {
    color: #3498db;
    font-weight: 600;
}

.sort-arrow {
    font-size: 10px;
    display: inline-block;
}

/* Team Filter Select */
.team-filter-select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    min-width: 150px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.team-filter-select:focus {
    outline: none;
    border-color: #3498db;
}

.team-filter-select:hover {
    border-color: #bdc3c7;
}

/* Board Table */
.board-table {
    width: 100%;
    background-color: white;
    border-collapse: collapse;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.board-table thead {
    background-color: #f8f9fa;
}

.board-table th {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.board-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

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

/* 번호 열 */
.board-table th:nth-child(1),
.board-table td:nth-child(1) {
    width: 80px;
    white-space: nowrap;
}

/* 제목 열 */
.board-table .title-cell {
    text-align: left;
    width: auto;
}

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

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

/* 구단 열 */
.board-table th:nth-child(3),
.board-table td:nth-child(3) {
    width: 100px;
    white-space: nowrap;
}

/* 작성자 열 */
.board-table th:nth-child(4),
.board-table td:nth-child(4) {
    width: 120px;
    white-space: nowrap;
}

/* 작성일 열 */
.board-table th:nth-child(5),
.board-table td:nth-child(5) {
    width: 120px;
    white-space: nowrap;
}

/* 좋아요 열 (메인 페이지) */
.board-table th:nth-child(6),
.board-table td:nth-child(6) {
    width: 80px;
    white-space: nowrap;
}

/* 댓글 열 (메인 페이지) */
.board-table th:nth-child(7),
.board-table td:nth-child(7) {
    width: 80px;
    white-space: nowrap;
}

/* 마이페이지 - 좋아요 열 (5번째) */
.my-posts-section .board-table th:nth-child(5),
.my-posts-section .board-table td:nth-child(5) {
    width: 80px;
    white-space: nowrap;
}

/* 마이페이지 - 댓글 열 (6번째) */
.my-posts-section .board-table th:nth-child(6),
.my-posts-section .board-table td:nth-child(6) {
    width: 80px;
    white-space: nowrap;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

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

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

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Alert Messages */
.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.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;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Comment Section */
.comment-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: #2c3e50;
}

.comment-date {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.comment-content {
    color: #555;
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 10px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

/* Mypage Layout */
.mypage-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.mypage-sidebar {
    display: flex;
    flex-direction: column;
}

.mypage-main {
    min-height: 500px;
}

/* Profile Card */
.profile-nickname {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.profile-email {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.profile-stat {
    text-align: center;
    transition: all 0.3s;
}

.profile-stat:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 3px;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Section Title */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-top: 12px;
    margin-bottom: 8px;
}

/* Team Info Card */
.team-info-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 15px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.team-header {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.team-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 10px 0;
}

.team-logo-small {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1;
}

.team-winrate {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px 0;
}

.winrate-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 12px solid #e74c3c;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

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

.winrate-label {
    font-size: 0.85rem;
    color: #bdc3c7;
    margin-bottom: 5px;
}

.winrate-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.team-stats-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 10px;
}

.team-stat-column {
    flex: 1;
    text-align: center;
}

.team-stat-label {
    font-size: 0.85rem;
    color: #bdc3c7;
    margin-bottom: 3px;
}

.team-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.stats-separator {
    width: 1px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 15px;
}

/* Account Menu */
.account-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.account-menu-item {
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #333;
}

.account-menu-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.account-menu-item span {
    font-size: 1.2rem;
}

/* My Posts Section */
.my-posts-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.my-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e74c3c;
}

.my-posts-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.post-count-badge {
    background: #e74c3c;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* My Board Item */
.my-board-item {
    padding: 18px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s;
}

.my-board-item:last-child {
    border-bottom: none;
}

.my-board-item:hover {
    background: #f8f9fa;
    padding-left: 25px;
}

.board-title-link {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.board-title-link:hover {
    color: #3498db;
}

.board-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.board-meta span {
    display: inline-flex;
    align-items: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    color: #95a5a6;
}

/* Modal Overlay Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #95a5a6;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.modal-content .flex.gap-10 button {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .form-container {
        padding: 20px;
        margin: 20px 10px;
    }

    .search-row {
        flex-direction: column;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .mypage-layout {
        grid-template-columns: 1fr;
    }
}
