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

body {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.mobile-container {
    max-width: 600px;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.flash {
    padding: 16px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    color: white;
    animation: slideIn 0.3s ease;
}

.flash.success { background: #10b981; }
.flash.error { background: #ef4444; }
.flash.info { background: #3b82f6; }

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

/* Login Page */
.login-box {
    max-width: 400px;
    margin: 60px auto;
    text-align: center;
}

.login-box h1 {
    color: #667eea;
    font-size: 32px;
    margin-bottom: 8px;
}

.login-box h2 {
    color: #666;
    font-size: 20px;
    margin-bottom: 32px;
    font-weight: normal;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    padding: 8px 12px;
    font-size: 18px;
    line-height: 1;
    min-width: auto;
    background: #B0A3D4;
    color: white;
}

.btn-icon:hover {
    background: #9b8dc7;
}

.btn-warning {
    background: #B0A3D4;
    color: white;
}

.btn-warning:hover {
    background: #9b8dc7;
}

.btn-danger.btn-icon:hover {
    background: #dc2626;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.admin-header h1 {
    color: #667eea;
    font-size: 28px;
}

.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.header-actions span {
    color: #666;
}

/* Actions */
.actions {
    margin-bottom: 24px;
}

/* Customer Grid */
.customers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.customer-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.customer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.customer-card h3 {
    color: #333;
    margin-bottom: 8px;
}

.customer-date {
    color: #999;
    font-size: 14px;
    margin-bottom: 16px;
}

.qr-code {
    text-align: center;
    margin: 16px 0;
}

.qr-code img {
    max-width: 150px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
}

.customer-links {
    margin: 12px 0;
}

.link-box {
    display: block;
    padding: 8px 12px;
    background: #f0f4ff;
    border: 1px solid #667eea;
    border-radius: 6px;
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s;
}

.link-box:hover {
    background: #667eea;
    color: white;
}

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

/* Upload Page */
.upload-header {
    text-align: center;
    margin-bottom: 32px;
}

.upload-header h1 {
    color: #667eea;
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    font-size: 16px;
}

.upload-area {
    margin-bottom: 24px;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9fafb;
}

.upload-label:hover {
    border-color: #667eea;
    background: #f3f4f6;
}

.upload-label svg {
    color: #667eea;
    margin-bottom: 16px;
}

.upload-label span {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

/* Preview Grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.preview-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Upload Progress */
.upload-progress {
    text-align: center;
    padding: 32px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Gallery */
.gallery-info {
    margin-bottom: 20px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 8px;
    text-align: center;
    color: #666;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    font-size: 12px;
    text-align: center;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 16px;
        border-radius: 12px;
    }

    .admin-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .customers-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .flash-messages {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .admin-header h1 {
        font-size: 22px;
    }

    .upload-header h1 {
        font-size: 24px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .customer-actions {
        flex-direction: column;
    }

    .customer-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
