/* G5SE - 기본 스타일시트 */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

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

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 15px 0;
}

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

.site-logo {
    margin: 0;
    font-size: 24px;
}

.site-logo a {
    color: #333;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: #555;
}

.main-nav a:hover {
    color: #0066cc;
}

/* Content */
.site-content {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

/* Footer */
.site-footer {
    background: #333;
    color: #ccc;
    padding: 20px 0;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

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

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn:hover {
    background: #f0f0f0;
    text-decoration: none;
}

.btn-primary {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

.btn-primary:hover {
    background: #0055aa;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-block {
    display: block;
    width: 100%;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

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

.form-group small {
    color: #888;
    font-size: 12px;
}

.required {
    color: #dc3545;
}

/* Auth Pages */
.auth-box {
    max-width: 400px;
    margin: 50px auto;
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-box.wide {
    max-width: 600px;
}

.auth-box h2 {
    margin: 0 0 30px;
    text-align: center;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links a {
    margin: 0 10px;
}

/* Board List */
.board-list-page {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
}

.page-title {
    margin: 0 0 20px;
    font-size: 24px;
}

.board-search {
    margin-bottom: 20px;
}

.board-search form {
    display: flex;
    gap: 10px;
}

.board-search select,
.board-search input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.board-search button {
    padding: 8px 20px;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

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

.board-list th,
.board-list td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.board-list th {
    background: #f8f8f8;
    font-weight: 500;
}

.board-list .col-no {
    width: 60px;
    text-align: center;
}

.board-list .col-name,
.board-list .col-date,
.board-list .col-hit {
    width: 100px;
    text-align: center;
}

.board-list .category {
    color: #888;
    margin-right: 5px;
}

.board-list .comment-count {
    color: #0066cc;
    font-size: 12px;
}

.board-list .empty {
    text-align: center;
    color: #888;
    padding: 50px;
}

.board-actions {
    margin-top: 20px;
    text-align: right;
}

/* Pagination */
.pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.pagination .current {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

/* Board View */
.board-view-page {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
}

.board-article {
    margin-bottom: 30px;
}

.article-header {
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.article-title {
    margin: 0 0 10px;
    font-size: 22px;
}

.article-meta {
    color: #888;
    font-size: 14px;
}

.article-meta span {
    margin-right: 15px;
}

.article-files {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.article-files ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

.article-content {
    min-height: 200px;
    padding: 20px 0;
    line-height: 1.8;
}

.article-actions {
    border-top: 1px solid #eee;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
}

.article-nav {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.article-nav a {
    display: block;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.article-nav a:last-child {
    border-bottom: none;
}

.article-nav .label {
    color: #888;
    margin-right: 10px;
}

/* Comments */
.comments {
    margin-top: 30px;
}

.comments h4 {
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

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

.comment-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.comment-meta {
    margin-bottom: 10px;
    font-size: 14px;
}

.comment-meta .author {
    font-weight: 500;
    margin-right: 10px;
}

.comment-meta .date {
    color: #888;
}

.comment-form {
    margin-top: 20px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 5px;
}

.comment-form .form-row {
    margin-bottom: 15px;
}

.comment-form input,
.comment-form textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.comment-form textarea {
    width: 100%;
    height: 100px;
    resize: vertical;
}

/* Shop */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.item-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.item-card:hover {
    transform: translateY(-5px);
}

.item-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.item-card .item-info {
    padding: 15px;
}

.item-card .item-name {
    margin: 0 0 10px;
    font-size: 16px;
}

.item-card .item-price {
    font-size: 18px;
    font-weight: bold;
    color: #0066cc;
}

.item-card .item-price del {
    font-size: 14px;
    color: #888;
    font-weight: normal;
}

/* Home */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #0066cc, #00cc99);
    color: #fff;
    border-radius: 10px;
    margin-bottom: 40px;
}

.hero h2 {
    margin: 0 0 15px;
    font-size: 36px;
}

.hero p {
    margin: 0;
    font-size: 18px;
    opacity: 0.9;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-item {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.feature-item h3 {
    margin: 0 0 10px;
}

.feature-item p {
    margin: 0;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .feature-grid,
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .board-search form {
        flex-wrap: wrap;
    }
    
    .board-list .col-date,
    .board-list .col-hit {
        display: none;
    }
}

/* Comments */
.comment-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.comment-section h3 {
    margin: 0 0 20px;
    font-size: 18px;
}

.comment-form {
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.comment-form-options {
    display: flex;
    gap: 15px;
}

.comment-form-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    cursor: pointer;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-item {
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.comment-item.comment-reply {
    margin-left: 40px;
    background: #f9f9f9;
}

.comment-item.comment-secret {
    background: #fefce8;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-name {
    font-weight: 600;
    color: #333;
}

.comment-date {
    font-size: 13px;
    color: #888;
}

.comment-badge {
    font-size: 12px;
    color: #666;
}

.comment-content {
    line-height: 1.7;
    word-break: break-word;
}

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

.comment-actions button {
    padding: 4px 10px;
    font-size: 12px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
}

.comment-actions button:hover {
    background: #f5f5f5;
}

.comment-actions .btn-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.reply-form-container {
    margin: 15px 0 15px 40px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.reply-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-family: inherit;
}

.reply-form-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.reply-form-actions label {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reply-form-actions button {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.reply-form-actions button[type="submit"] {
    margin-left: auto;
}

.no-comments {
    text-align: center;
    padding: 30px;
    color: #888;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 15px 25px;
    background: #333;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: #22c55e;
}

.toast-error {
    background: #ef4444;
}

.toast-info {
    background: #3b82f6;
}

@media (max-width: 768px) {
    .comment-item.comment-reply {
        margin-left: 20px;
    }
    
    .reply-form-container {
        margin-left: 20px;
    }
    
    .comment-form-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
