/* Photo Upload Page Styles - Mobile-First Design */
/* This is a standalone style, separate from the main Woodline Studio theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.photo-upload-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

.upload-container {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
    box-sizing: border-box;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .upload-container {
        padding: 24px 16px;
        border-radius: 20px;
        margin: 0;
        max-width: 100%;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-header {
    text-align: center;
    margin-bottom: 32px;
}

.upload-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.upload-header .subtitle {
    font-size: 16px;
    color: #718096;
    font-weight: 400;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.upload-area:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.upload-area.drag-over {
    border-color: #667eea;
    background: #e6fffa;
    transform: scale(1.02);
}

.upload-placeholder {
    pointer-events: none;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: #a0aec0;
    margin: 0 auto 16px;
    display: block;
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: #718096;
}

.preview-container {
    margin-bottom: 24px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.preview-item {
    background: #f7fafc;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Square aspect ratio */
    background: #edf2f7;
    overflow: hidden;
}

.preview-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 10;
}

.remove-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.remove-btn svg {
    width: 18px;
    height: 18px;
    color: #e53e3e;
}

.preview-info {
    padding: 12px;
}

.preview-name {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-size {
    font-size: 11px;
    color: #718096;
}

.upload-progress {
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: #4a5568;
    text-align: center;
    font-weight: 500;
}

.upload-actions {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:not(:disabled):active {
    transform: translateY(0);
}

.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.message {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-success {
    background: #c6f6d5;
    color: #22543d;
    border: 2px solid #9ae6b4;
}

.message-error {
    background: #fed7d7;
    color: #742a2a;
    border: 2px solid #fc8181;
}

/* Gallery Section */
.gallery-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid #e2e8f0;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gallery-header {
    margin-bottom: 24px;
    text-align: center;
}

.gallery-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.gallery-count {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gallery-item {
    background: #f7fafc;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    animation: slideUp 0.4s ease-out;
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.gallery-link {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.gallery-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Square aspect ratio - creates height based on width */
    background: #edf2f7;
    overflow: hidden;
    max-width: 100%;
    height: 0;
    margin: 0;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block;
    margin: 0;
    padding: 0;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-item:active {
    transform: scale(0.98);
}

.gallery-info {
    padding: 10px 8px;
    flex-shrink: 0;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.gallery-name {
    font-size: 11px;
    font-weight: 500;
    color: #4a5568;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
    text-align: center;
    width: 100%;
    line-height: 1.4;
}

/* Pagination */
.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    background: #ffffff;
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #667eea;
    background: #f7fafc;
    color: #667eea;
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.pagination-btn svg {
    width: 18px;
    height: 18px;
}

.pagination-info {
    font-size: 14px;
    font-weight: 500;
    color: #718096;
    min-width: 120px;
    text-align: center;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .upload-container {
        padding: 48px 40px;
    }

    .upload-header h1 {
        font-size: 32px;
    }

    .preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop */
@media (min-width: 1024px) {
    .preview-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile adjustments - minimal changes, just spacing */
@media (max-width: 768px) {
    body.photo-upload-page {
        padding: 12px;
    }

    .upload-area,
    .btn {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

