/**
 * Photo Editor Styles
 * 写真編集UI専用スタイル
 */

/* Editor Container */
.photo-editor-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

/* Canvas Container */
.editor-canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
    position: relative;
}

.editor-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Tab Navigation */
.editor-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-tab {
    flex: 1;
    padding: 15px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.editor-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.editor-tab.active {
    color: #ffffff;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Controls Panel */
.editor-controls {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.controls-content {
    display: none;
}

.controls-content.active {
    display: block;
}

/* Filter Gallery */
.filter-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.filter-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-item:active {
    transform: scale(0.95);
}

.filter-preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 3px solid transparent;
    overflow: hidden;
    transition: all 0.3s;
    background: #333;
}

.filter-item.selected .filter-preview {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.filter-preview canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.filter-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.filter-item.selected .filter-name {
    color: #667eea;
    font-weight: 600;
}

/* Stamp Gallery */
.stamp-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.stamp-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.stamp-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
}

.stamp-item:active {
    transform: scale(0.95);
}

.stamp-item img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    pointer-events: none;
}

/* Stamp Controls (when stamp is selected) */
.stamp-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.stamp-control-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stamp-control-label {
    min-width: 60px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
}

.stamp-control-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
}

.stamp-control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.stamp-control-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.stamp-control-value {
    min-width: 50px;
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
}

.stamp-action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.stamp-action-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.stamp-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.stamp-action-btn.delete {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
}

.stamp-action-btn.delete:hover {
    background: rgba(220, 53, 69, 0.3);
}

/* Frame Preview (Tab 2) */
.frame-preview-info {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
}

/* Action Buttons */
.editor-actions {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.editor-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.editor-btn.cancel:active {
    background: rgba(255, 255, 255, 0.15);
}

.editor-btn.done {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.editor-btn.done:active {
    transform: scale(0.98);
}

/* Loading Overlay */
.editor-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.editor-loading.active {
    display: flex;
}

.editor-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .editor-tab {
        font-size: 12px;
        padding: 12px 8px;
    }

    .filter-preview {
        width: 70px;
        height: 70px;
    }

    .filter-name {
        font-size: 11px;
    }

    .stamp-gallery {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 10px;
    }

    .editor-controls {
        padding: 15px;
        max-height: 45vh;
    }

    .editor-btn {
        font-size: 14px;
        padding: 12px;
    }
}

/* Scrollbar Styling */
.filter-gallery::-webkit-scrollbar,
.editor-controls::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.filter-gallery::-webkit-scrollbar-track,
.editor-controls::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.filter-gallery::-webkit-scrollbar-thumb,
.editor-controls::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.filter-gallery::-webkit-scrollbar-thumb:hover,
.editor-controls::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Section Headers */
.editor-section-header {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Empty State */
.editor-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.editor-empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.editor-empty-state-text {
    font-size: 14px;
    line-height: 1.6;
}

/* Stamp Sub-Tabs */
.stamp-sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stamp-sub-tab {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.stamp-sub-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.stamp-sub-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.stamp-sub-content {
    display: none;
}

.stamp-sub-content.active {
    display: block;
}

/* Date Stamp Section */
.editor-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.date-stamp-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 15px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-row label {
    min-width: 80px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
}

.date-stamp-select {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.date-stamp-select:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(102, 126, 234, 0.5);
}

.date-stamp-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.date-stamp-select option {
    background: #2a2a2a;
    color: white;
    padding: 8px;
}

.add-date-stamp-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.add-date-stamp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.add-date-stamp-btn:active {
    transform: translateY(0);
}

.date-stamp-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-top: 15px;
}

/* Stamp Control Row (shared with regular stamps) */
.stamp-control-row span {
    min-width: 60px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
}

.stamp-control-row input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
}

.stamp-control-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.stamp-control-row input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

/* Desktop Support - 800px max-width with centered layout */
@media (min-width: 768px) {
    .photo-editor-container {
        max-width: 800px;
        left: 50%;
        transform: translateX(-50%);
    }
}
