:root {
    --primary: #0070f3;
    --primary-hover: #0051cc;
    --secondary: #ff3366;
    --accent: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --text-dark: #1a1a1a;
    --text-gray: #666;
    --text-light: #999;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #f1f5f9;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --header-height: 70px;
    --max-content-width: 1400px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
            radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundMove 20s ease-in-out infinite;
}

@keyframes backgroundMove {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

/* 통일된 헤더 스타일 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.header-content {
    width: 100%;
    max-width: var(--max-content-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.header-nav {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.header-nav-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    color: var(--text-gray);
    white-space: nowrap;
}

.header-nav-link:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    letter-spacing: -0.02em;
}

.logo:hover {
    transform: scale(1.03);
}

.header-search {
    flex: 1;
    max-width: 500px;
}

.header-search form {
    position: relative;
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 0.65rem var(--spacing-md) 0.65rem 2.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

.search-input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.08);
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.user-info {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.auth-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    color: var(--text-gray);
    cursor: pointer;
    white-space: nowrap;
}

.auth-button:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.logout-button {
    background: var(--text-dark);
    color: white;
}

.logout-button:hover {
    background: var(--text-gray);
}

/* Main Content */
.main-content {
    margin-top: calc(var(--header-height) + 2rem);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem;
}

.product-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

/* Product Image */
.image-section {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
}

.product-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-image:hover {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 112, 243, 0.1), rgba(124, 58, 237, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-section:hover .image-overlay {
    opacity: 1;
}

/* Product Info */
.info-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.product-description {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 2rem;
}

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

.meta-item {
    background: rgba(0, 112, 243, 0.05);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(0, 112, 243, 0.1);
}

.meta-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.meta-value {
    font-weight: 600;
    color: var(--text-dark);
}

.sold-out-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--error), #dc2626);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    margin-bottom: 2rem;
}

/* Actions */
.product-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.quantity-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quantity-label {
    font-weight: 600;
    color: var(--text-dark);
}

.quantity-control {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.quantity-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--bg-light);
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--primary);
    color: white;
}

.quantity-btn:disabled {
    background: var(--bg-gray);
    color: var(--text-light);
    cursor: not-allowed;
}

.quantity-input {
    width: 80px;
    height: 48px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    background: var(--bg-white);
    outline: none;
}

.action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before {
    left: 100%;
}

.btn-cart {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
}

.btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-wishlist {
    background: linear-gradient(135deg, var(--secondary), #e11d48);
    color: white;
}

.btn-wishlist:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-btn:disabled {
    background: var(--bg-gray);
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Reviews Section */
.reviews-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05), rgba(255, 152, 0, 0.05));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 193, 7, 0.2);
    margin-bottom: 2rem;
}

.rating-stars {
    font-size: 2rem;
    color: #ffc107;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rating-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.rating-text {
    color: var(--text-gray);
    font-size: 1.1rem;
}

.reviews-list {
    list-style: none;
    margin-bottom: 3rem;
}

.review-item {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.review-item:hover {
    box-shadow: var(--shadow);
    background: rgba(255, 255, 255, 0.9);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reviewer-name {
    font-weight: 600;
    color: var(--text-dark);
}

.review-rating {
    color: #ffc107;
    font-size: 1.1rem;
}

.review-date {
    color: var(--text-light);
    font-size: 0.875rem;
}

.review-content {
    color: var(--text-gray);
    line-height: 1.6;
}

.review-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.review-action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.review-edit-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
}

.review-delete-btn {
    background: linear-gradient(135deg, var(--error), #dc2626);
    color: white;
}

.review-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.review-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.my-review-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, rgba(0, 112, 243, 0.1), rgba(124, 58, 237, 0.1));
    color: var(--primary);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Review Form */
.review-form-section {
    background: linear-gradient(135deg, rgba(0, 112, 243, 0.05), rgba(124, 58, 237, 0.05));
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(0, 112, 243, 0.1);
}

.form-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-select {
    width: 200px;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-white);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.1);
}

.form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-white);
    transition: border-color 0.3s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.1);
}

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

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Edit Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

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

.edit-form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.edit-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.edit-form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.1);
}

textarea.edit-form-control {
    resize: vertical;
    min-height: 120px;
}

.edit-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.edit-btn-secondary {
    background: var(--bg-gray);
    color: var(--text-dark);
    border: 2px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn-secondary:hover {
    background: var(--border);
}

.edit-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 112, 243, 0.3);
}

/* Notification */
.notification {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--error);
}

/* Responsive */
@media (max-width: 1024px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-actions {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .header-content {
        padding: 0 var(--spacing-md);
    }

    .logo {
        font-size: 1.3rem;
    }

    .header-search {
        display: none;
    }

    .header-nav {
        display: none;
    }

    .auth-button span {
        display: none;
    }

    .main-content {
        padding: 1rem;
        margin-top: calc(var(--header-height) + 1rem);
    }

    .product-container,
    .reviews-section {
        padding: 2rem 1rem;
    }

    .product-title {
        font-size: 2rem;
    }

    .product-price {
        font-size: 1.5rem;
    }

    .product-meta {
        grid-template-columns: 1fr;
    }

    .rating-summary {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .product-container,
    .reviews-section {
        padding: 1.5rem 0.75rem;
    }

    .product-image {
        height: 300px;
    }

    .quantity-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}
