/* public/css/admin.css */

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

body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    min-height: 100vh;
    color: white;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* 헤더 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ffd700;
}

header h1 {
    color: #ffd700;
    font-size: 28px;
}

/* 버튼 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background: #ffd700;
    color: #000;
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.btn:hover {
    transform: scale(1.05);
}

/* 카드 */
.card {
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.card h2 {
    color: #00f5ff;
    margin-bottom: 20px;
    font-size: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ffd700;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00f5ff;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 12px;
}

/* 색상 입력 */
.color-inputs {
    display: flex;
    gap: 20px;
}

.color-input {
    flex: 1;
}

.color-input input[type="color"] {
    width: 100%;
    height: 50px;
    padding: 5px;
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.1);
}

/* 토글 */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle {
    width: 60px;
    height: 30px;
    background: #444;
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle.active {
    background: #00f5ff;
}

.toggle::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
}

.toggle.active::after {
    left: 33px;
}

/* 미리보기 */
.preview {
    background: rgba(0,0,0,0.5);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.preview h3 {
    color: #888;
    margin-bottom: 15px;
    font-size: 14px;
}

.preview-platform {
    padding: 20px 40px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.preview-platform img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
}

/* 슬로건 */
.slogan-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slogan-item {
    display: flex;
    gap: 10px;
}

.slogan-item input {
    flex: 1;
}

.slogan-item .btn-remove {
    background: #ff4444;
    color: white;
    padding: 10px 15px;
}

.btn-add-slogan {
    margin-top: 10px;
    background: rgba(0, 245, 255, 0.2);
    color: #00f5ff;
    border: 1px dashed #00f5ff;
}

/* 이미지 탭 */
.image-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    padding: 10px 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #888;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.tab-btn.active {
    background: rgba(0, 245, 255, 0.2);
    border-color: #00f5ff;
    color: #00f5ff;
}

.image-tab-content {
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    margin-bottom: 15px;
}

.image-tab-content.hidden {
    display: none;
}

.url-input-group {
    display: flex;
    gap: 10px;
}

.url-input-group input {
    flex: 1;
}

.url-input-group .btn {
    white-space: nowrap;
}

/* 이미지 업로드 */
.image-upload-area {
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.image-upload-area:hover {
    border-color: #00f5ff;
    background: rgba(0, 245, 255, 0.05);
}

.image-upload-area input {
    display: none;
}

.image-upload-area .upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.image-upload-area p {
    color: #888;
    font-size: 14px;
}

.image-preview-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    margin-top: 15px;
}

.image-preview {
    width: 120px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    padding: 5px;
}

.image-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-info span {
    color: #888;
    font-size: 12px;
}

.btn-remove-image {
    background: #ff4444;
    color: white;
    padding: 8px 15px;
    font-size: 12px;
}

/* 업로드 프로그레스 */
.upload-progress {
    margin-top: 10px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.upload-progress.show {
    display: block;
}

.upload-progress-bar {
    height: 100%;
    background: #00f5ff;
    width: 0%;
    transition: width 0.3s;
}

/* 프리셋 */
.preset-section {
    margin-bottom: 20px;
}

.preset-section h3 {
    color: #888;
    font-size: 14px;
    margin-bottom: 10px;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-btn {
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.preset-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: #00f5ff;
}

/* 토스트 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #44ff44;
    color: #000;
}

.toast.error {
    background: #ff4444;
    color: white;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 권한 없음 */
.not-admin {
    text-align: center;
    padding: 100px 20px;
}

.not-admin h2 {
    color: #ff4444;
    margin-bottom: 20px;
}

/* 로딩 */
.loading {
    text-align: center;
    padding: 50px;
    color: #888;
}

/* 반응형 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .color-inputs {
        flex-direction: column;
    }
    
    .image-tabs {
        flex-direction: column;
    }
    
    .preset-buttons {
        justify-content: center;
    }
    
    .image-preview-container {
        flex-direction: column;
        text-align: center;
    }
}

.btn-save {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    font-size: 16px;
}
/* admin.css에 추가 */

/* 카드 헤더 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* 광고 목록 */
.ad-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ad-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s;
}

.ad-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
}

.ad-item.inactive {
    opacity: 0.5;
}

.ad-preview {
    width: 120px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.ad-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

.ad-company {
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.ad-info {
    flex: 1;
}

.ad-info h3 {
    margin-bottom: 5px;
    font-size: 16px;
}

.ad-slogans {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.slogan-tag {
    padding: 2px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    font-size: 11px;
    color: #888;
}

.slogan-more {
    padding: 2px 8px;
    background: rgba(0,245,255,0.2);
    border-radius: 10px;
    font-size: 11px;
    color: #00f5ff;
}

.ad-meta {
    display: flex;
    gap: 15px;
    font-size: 11px;
    color: #666;
}

.ad-meta .status.on {
    color: #44ff44;
}

.ad-meta .status.off {
    color: #ff4444;
}

.ad-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.1);
}

.btn-icon.danger:hover {
    background: rgba(255,68,68,0.3);
    border-color: #ff4444;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

/* 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 폼 행 */
.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

/* 플랫폼 미리보기 */
.preview-platform {
    position: relative;
    padding: 25px 50px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 80px;
}

.preview-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.orbit-logo {
    position: absolute;
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;
    animation: orbit 3s linear infinite;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.5));
}

@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(80px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(80px) rotate(-360deg);
    }
}

.preview-text {
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 1;
}
