/* Activity Admin Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.admin-header h1 {
    font-size: 24px;
    color: #FFD45A;
    letter-spacing: 2px;
}

.storage-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.storage-toggle label {
    font-size: 14px;
    color: #aaa;
}

.storage-toggle select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2a2a4a;
    color: #fff;
    font-size: 13px;
}

/* Main Layout */
.admin-main {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* Control Panel - Compact */
.control-panel {
    width: 280px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(10px);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.control-panel h3 {
    font-size: 14px;
    color: #FFD45A;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-panel hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 12px 0;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 5px;
    border: 1px solid #444;
    background: #2a2a4a;
    color: #fff;
    font-size: 13px;
}

.form-group textarea {
    resize: vertical;
    min-height: 50px;
}

#imagePreviewThumb {
    margin-top: 5px;
}

#imagePreviewThumb img {
    max-width: 100%;
    max-height: 80px;
    border-radius: 5px;
    border: 1px solid #444;
}

/* Multi-image preview for result images */
.multi-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.result-thumb {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 212, 90, 0.3);
}

.result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Style Controls - Compact */
.style-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.style-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.style-row label {
    font-size: 11px;
    color: #aaa;
    width: 60px;
    flex-shrink: 0;
}

.compact-select {
    flex: 1;
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #2a2a4a;
    color: #fff;
    font-size: 11px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-buttons button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #E49E45 0%, #FFD45A 100%);
    color: #1a1a2e;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #5dd879 100%);
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.action-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Image Size Slider */
.image-size-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.image-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #2a2a4a 0%, #FFD45A 100%);
    border-radius: 3px;
    cursor: pointer;
}

.image-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFD45A;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.image-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFD45A;
    cursor: pointer;
    border: none;
}

#imageSizeValue {
    font-size: 11px;
    color: #FFD45A;
    min-width: 45px;
    text-align: right;
}

/* Number Size Slider */
.number-size-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.number-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #2a2a4a 0%, #FFD45A 100%);
    border-radius: 3px;
    cursor: pointer;
}

.number-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFD45A;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.number-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFD45A;
    cursor: pointer;
    border: none;
}

#numberSizeValue {
    font-size: 11px;
    color: #FFD45A;
    min-width: 45px;
    text-align: right;
}

/* Preview Section */
.preview-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.preview-section h3 {
    font-size: 14px;
    color: #FFD45A;
    margin-bottom: 10px;
}

.preview-section h3 .hint {
    font-size: 11px;
    color: #888;
    font-weight: normal;
}

.preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d0d1a;
    border-radius: 8px;
    min-height: 400px;
    overflow: hidden;
}

.preview-area {
    width: 600px;
    height: 350px;
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #0d0d1a 100%);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

/* Draggable Elements */
.draggable-element {
    position: absolute;
    cursor: move;
    padding: 8px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.2s;
    user-select: none;
}

.draggable-element:hover {
    box-shadow: 0 0 15px rgba(255, 212, 90, 0.3);
    border-color: #FFD45A;
}

.draggable-element.dragging {
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Fixed element - not draggable */
.fixed-element {
    cursor: default !important;
}

.fixed-element:hover {
    box-shadow: none;
    border-color: rgba(255, 212, 90, 0.3);
}

/* Fixed size element - cannot be resized but can be dragged */
.fixed-size {
    resize: none !important;
}

/* Element Specific Styles */
#dragTitle {
    font-family: 'Noto Serif TC', 宋体, SimSun, serif;
    font-size: 30px;
    color: #F55660;
    left: 50%;
    top: 30px;
    transform: translateX(-50%);
    background: transparent;
    border: 1px dashed rgba(245, 86, 96, 0.3);
}

#dragDate {
    font-family: Questrial, sans-serif;
    font-size: 14px;
    color: #F55660;
    left: 50%;
    top: 90px;
    transform: translateX(-50%);
    background: transparent;
    border: 1px dashed rgba(245, 86, 96, 0.3);
}

#dragDesc {
    font-family: 'Microsoft YaHei', 微軟雅黑, sans-serif;
    font-size: 13px;
    color: #adadad;
    left: 50%;
    top: 130px;
    transform: translateX(-50%);
    max-width: 300px;
    text-align: center;
    background: transparent;
    border: 1px dashed rgba(173, 173, 173, 0.3);
}

#dragImage {
    left: 50%;
    top: 180px;
    transform: translateX(-50%);
    padding: 0;
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.image-placeholder {
    width: 250px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: #666;
    font-size: 14px;
}

#dragNumber {
    font-family: 'Pacifica Condensed', sans-serif;
    font-size: 122px;
    color: #FFD45A;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    line-height: 1;
    background: transparent;
    border: 1px dashed rgba(255, 212, 90, 0.3);
}

#dragButton {
    background: linear-gradient(135deg, #E49E45 0%, #d4893a 100%);
    color: #fff;
    font-size: 14px;
    padding: 10px 25px;
    border-radius: 25px;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    border: none;
}

/* Activity List Section */
.activity-list-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(10px);
}

.activity-list-section h3 {
    font-size: 14px;
    color: #FFD45A;
    margin-bottom: 15px;
}

#activityListAdmin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.activity-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.activity-card:hover {
    border-color: #FFD45A;
    transform: translateY(-3px);
}

.activity-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.activity-card-title {
    font-size: 16px;
    color: #F55660;
    font-weight: bold;
    flex: 1;
}

.activity-card-number {
    font-size: 14px;
    color: #FFD45A;
    font-weight: bold;
    margin-right: 10px;
}

.activity-card-id {
    font-size: 11px;
    color: #666;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.activity-card-date {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
}

.activity-card-desc {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-card-actions {
    display: flex;
    gap: 8px;
}

.activity-card-actions button {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit {
    background: rgba(255, 212, 90, 0.2);
    color: #FFD45A;
}

.btn-delete {
    background: rgba(245, 86, 96, 0.2);
    color: #F55660;
}

.activity-card-actions button:hover {
    transform: scale(1.05);
}

/* Scrollbar */
.control-panel::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 900px) {
    .admin-main {
        flex-direction: column;
    }

    .control-panel {
        width: 100%;
        max-height: none;
    }

    .preview-area {
        width: 100%;
        height: 300px;
    }
}