/* 메인 페이지 스타일시트 */

/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* 헤더 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.logo i {
    margin-right: 0.5rem;
    color: #ffd700;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

.nav a:hover,
.nav a.active {
    background-color: rgba(255,255,255,0.2);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-info {
    color: white;
    font-weight: 600;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.badge-admin {
    background-color: #28a745;
    color: white;
}

.badge-user {
    background-color: #007bff;
    color: white;
}

/* 검색 섹션 */
.search-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e9ecef;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.clear-search {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: #6c757d;
    text-decoration: none;
}

.clear-search:hover {
    color: #495057;
}

/* 메인 콘텐츠 */
.main {
    padding: 3rem 0;
}

/* 통계 섹션 */
.stats-section {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 제품 섹션 */
.products-section {
    margin-bottom: 3rem;
}

.products-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.products-section .section-header h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.products-section .section-header p {
    color: #6c757d;
    font-size: 1.1rem;
}

.products-section .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.products-section .products-grid .product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s, outline 0.2s;
    cursor: pointer;
    width: 350px;
    height: 480px;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    position: relative;
}

.products-section .products-grid .product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.05);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1;
}

.products-section .products-grid .product-card:hover::before,
.products-section .products-grid .product-card:focus::before {
    opacity: 1;
}

.products-section .products-grid .product-card:hover,
.products-section .products-grid .product-card:focus {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.products-section .products-grid .product-image {
    height: 270px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.products-section .products-grid .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.products-section .products-grid .product-content {
    padding: 1rem 1.2rem 0.8rem 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.product-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.product-description img {
    max-width: 100%;
    height: auto;
    margin: 0.5rem 0;
}

.product-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.2rem;
}

.product-date i {
    margin-right: 0.25rem;
}

/* 제품 상세 페이지 스타일 */
.product-detail-header {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.product-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.product-detail-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

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

.product-image-section {
    text-align: center;
    margin-bottom: 2rem;
}

.product-main-image {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.product-description-section {
    margin-top: 2rem;
}

.product-description-content {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    line-height: 1.8;
    font-size: 1.1rem;
}

.product-description-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 8px;
}

.product-description-content iframe {
    max-width: 100%;
    margin: 1rem 0;
    border-radius: 8px;
}

.product-description-content a {
    color: #667eea;
    text-decoration: underline;
}

.product-description-content a:hover {
    color: #5a6fd8;
}

.breadcrumb {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.close:hover {
    color: #ffd700;
}

.modal-body {
    padding: 2rem;
}

.product-modal .modal-content {
    max-width: 1000px;
}

.product-detail-modal {
    display: flex;
    gap: 2rem;
}

.product-detail-modal .product-image-section {
    flex: 1;
}

.product-detail-modal .product-main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.product-detail-modal .product-info-section {
    flex: 1;
    padding: 0 1rem;
}

.product-detail-modal .product-category {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.product-detail-modal .product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 1rem;
}

.product-detail-modal .product-description {
    color: #495057;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.product-detail-modal .product-meta {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    display: flex;
    gap: 2rem;
}

.product-detail-modal .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.product-detail-modal .meta-item i {
    color: #667eea;
    width: 16px;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #667eea;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin: 1rem 0;
}

/* 회원가입 폼 - 원래 스타일 */
.auth-container, .register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem 0;
}

.auth-card, .register-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-header, .register-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form, .register-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group label {
    font-weight: 600;
    color: #495057;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-block {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.register-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.register-footer p {
    margin-bottom: 0.5rem;
}

.register-footer a {
    color: #667eea;
    text-decoration: none;
}

.register-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

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

/* 푸터 */
.footer {
    background: #343a40;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer .footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col {
    padding: 0 1rem;
}

.footer-col h3 {
    color: #ffd700;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col h3 i {
    color: #667eea;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: #ffd700;
}

.footer .fb-box {
    background: #3b5998;
    color: white;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 1rem;
}

.footer .store-btn {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    margin: 0.5rem;
    transition: background-color 0.3s;
}

.footer .store-btn:hover {
    background: #218838;
    color: white;
}

.footer-bottom {
    border-top: 1px solid #495057;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom .copyright {
    color: #adb5bd;
}

.footer-bottom .social-icons {
    display: flex;
    gap: 0.5rem;
}

.footer-bottom .social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: transform 0.3s;
}

.footer-bottom .social-icons a:hover {
    transform: scale(1.1);
}

.footer-bottom .social-icons .fa-facebook { background: #3b5998; }
.footer-bottom .social-icons .fa-twitter { background: #55acee; }
.footer-bottom .social-icons .fa-youtube { background: #cd201f; }
.footer-bottom .social-icons .fa-google-plus { background: #dd4b39; }
.footer-bottom .social-icons .fa-pinterest { background: #cb2027; }
.footer-bottom .social-icons .fa-rss { background: #f26522; }
.footer-bottom .social-icons .fa-envelope { background: #ff9800; }

@media (max-width: 900px) {
    .footer .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-col {
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* 버튼 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline:hover {
    background: white;
    color: #667eea;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav ul {
        gap: 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .search-input-group {
        flex-direction: column;
        border-radius: 10px;
    }
    
    .search-input,
    .search-btn {
        border-radius: 0;
    }
    
    .search-input {
        border-bottom: 1px solid #e9ecef;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease-out;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 접근성 */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid #333;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #fff;
    }
    
    .product-card,
    .stat-card,
    .register-card {
        background: #2d2d2d;
        color: #fff;
    }
    
    .search-section {
        background: #2d2d2d;
    }
    
    .search-input {
        background: #2d2d2d;
        color: #fff;
        border-color: #444;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .product-detail-modal {
        flex-direction: column;
    }
    
    .register-card {
        margin: 0 1rem;
    }
} 