/* ===== RESET & VARIABLES ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.02);
    --radius: 16px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(145deg, #f5f7fb 0%, #f0f2f6 100%);
    color: var(--gray-800);
    line-height: 1.5;
    padding: 24px 20px;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    margin-bottom: 24px;
    transition: all 0.2s ease;
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-800);
    border-bottom: 2px solid var(--gray-100);
    padding-bottom: 16px;
}

/* ===== HEADER / TRUST ===== */
header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(145deg, var(--primary), #1e40af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--gray-600);
    font-size: 1.1rem;
}

.trust-note {
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 40px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #1e40af;
    font-weight: 500;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 3px dashed var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
    padding: 48px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-icon i {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.upload-area h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.file-types {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 20px;
}

/* file info */
.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-top: 20px;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-icon i {
    font-size: 2.5rem;
    color: var(--danger);
}

.file-text h4 {
    font-weight: 600;
    margin-bottom: 4px;
}

.file-meta {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.15s;
    background: white;
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
    border: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* ===== TABS ===== */
.type-tabs {
    display: flex;
    gap: 8px;
    background: var(--gray-100);
    padding: 6px;
    border-radius: 40px;
    margin-bottom: 32px;
}

.type-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 32px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.15s;
}

.type-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.watermark-panel {
    display: none;
}

.watermark-panel.active {
    display: block;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 8px;
}

.form-row .form-group {
    flex: 1 1 200px;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    background: white;
}

input[type="range"] {
    width: 100%;
    margin: 8px 0;
    accent-color: var(--primary);
}

.range-value {
    display: inline-block;
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-dark);
}

input[type="color"] {
    width: 100%;
    height: 48px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    margin-top: 16px;
    padding: 12px 0;
    cursor: pointer;
}

/* ===== IMAGE UPLOAD ===== */
.image-upload-area {
    border: 2px dashed var(--gray-200);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    background: var(--gray-50);
    cursor: pointer;
}

.image-upload-area i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.image-preview {
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    background: white;
}

#preview-img {
    max-width: 100%;
    max-height: 200px;
    margin-bottom: 16px;
    border-radius: 8px;
}

/* ===== COMMON OPTIONS ===== */
.common-options {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--gray-100);
}

.common-options h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* ===== PREVIEW ===== */
.preview-container {
    background: #f9fafb;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.preview-placeholder {
    text-align: center;
    color: var(--gray-600);
}

.preview-placeholder i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.small {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: block;
    margin-top: 12px;
}

#preview-canvas {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
}

/* ===== PROCESSING SPINNER ===== */
.processing {
    text-align: center;
    padding: 32px;
    background: rgba(255,255,255,0.8);
    border-radius: var(--radius);
    margin-top: 24px;
}

.spinner {
    border: 5px solid var(--gray-200);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--gray-600);
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-200);
    text-align: right;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 24px;
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .card {
        padding: 20px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .action-buttons .btn {
        width: 100%;
    }
    .file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}