* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    background: white;
    border: 3px dashed #667eea;
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.upload-area.drag-over {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-area p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9em !important;
    color: #999;
}

/* Controls Section */
.controls-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.controls-panel h3 {
    margin-bottom: 25px;
    color: #667eea;
    font-size: 1.5em;
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.control-group input[type="text"],
.control-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.control-group input[type="text"]:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.toggle-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-item:hover {
    background: #e8eaff;
}

.toggle-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #667eea;
}

.toggle-item span {
    font-weight: 500;
    color: #555;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #555;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* Gallery Section */
.gallery-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.gallery-section h3 {
    margin-bottom: 25px;
    color: #667eea;
    font-size: 1.5em;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.gallery-item {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.gallery-item-info {
    font-size: 0.9em;
    color: #666;
}

.gallery-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-item {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 30px;
    height: 30px;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.3s;
}

.remove-item:hover {
    background: rgba(255, 59, 48, 1);
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    position: relative;
    margin: 2% auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close-modal:hover {
    color: #667eea;
}

.preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.modal-actions {
    text-align: center;
}

/* Polaroid Card Styles */
.polaroid-card {
    background: white;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: inline-block;
    max-width: 100%;
}

.polaroid-image {
    display: block;
    width: 100%;
    height: auto;
}

.polaroid-caption {
    background: white;
    padding: 25px 20px 20px;
    font-family: 'Courier New', monospace;
}

.polaroid-exif {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #444;
}

.exif-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.exif-label {
    font-weight: 600;
    color: #666;
}

.polaroid-brand {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.polaroid-trademark {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85em;
    color: #888;
    text-align: center;
    font-style: italic;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .toggle-grid {
        grid-template-columns: 1fr;
    }
}
