/* WooniBox Custom Styles */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Period Button Active State */
.period-btn.active {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Table Hover Effect */
table tbody tr:hover {
    background-color: #f9fafb;
}

/* Chart Container */
canvas {
    max-height: 300px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Ad Preview Styles */
.ad-preview {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.ad-preview:hover {
    border-color: #2563eb;
}

.ad-preview-horizontal {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
}

.ad-preview-horizontal img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 16px;
}

.ad-preview-vertical {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: white;
}

.ad-preview-vertical img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 12px;
}

.ad-preview-square {
    padding: 12px;
    background: white;
}

.ad-preview-square img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 12px;
}

/* 배너 스타일 광고 (이미지 전체) */
.ad-preview-banner {
    position: relative;
    overflow: hidden;
    background: white;
    cursor: pointer;
}

.ad-preview-banner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.ad-preview-banner .ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 20px;
    color: white;
}

.ad-preview-banner .ad-title {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.ad-preview-banner .ad-content {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.ad-preview-banner:hover {
    transform: scale(1.02);
    transition: transform 0.2s;
}

.ad-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.4;
}

.ad-content {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 8px;
}

.ad-link {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
}

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

/* Code Block */
.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    position: relative;
}

.code-block pre {
    margin: 0;
}

.copy-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-button:hover {
    background: #2563eb;
}

.copy-button.copied {
    background: #10b981;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

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

.modal-content {
    background-color: white;
    padding: 32px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Form Elements */
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    ring: 2px;
    ring-color: rgba(37, 99, 235, 0.2);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: white;
    color: #374151;
    border-color: #d1d5db;
}

.btn-secondary:hover {
    background: #f9fafb;
}

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

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

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-green {
    background: #dcfce7;
    color: #166534;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.badge-gray {
    background: #f3f4f6;
    color: #4b5563;
}

/* Responsive */
@media (max-width: 768px) {
    .ad-preview-horizontal {
        flex-direction: column;
    }
    
    .ad-preview-horizontal img {
        width: 100%;
        height: 180px;
        margin-right: 0;
        margin-bottom: 12px;
    }
}
