/* SunrisePro Tools - CSS */
:root {
    --primary: #e63946;
    --primary-dark: #c62838;
    --secondary: #1d3557;
    --accent: #457b9d;
    --light: #f1faee;
    --dark: #1d3557;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--dark);
    font-size: 20px;
}

.site-header .logo i {
    color: var(--primary);
    font-size: 24px;
}

.site-header .logo strong {
    color: var(--primary);
}

.main-nav {
    display: flex;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--primary);
}

/* Main Content */
.site-main {
    flex: 1;
    padding: 40px 0;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--dark);
    margin-bottom: 10px;
}

.page-header p {
    color: var(--gray-600);
    font-size: 18px;
}

/* Tool Cards Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.tool-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--gray-200);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tool-card .icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

.tool-card .icon.red { background: #fee2e2; color: #dc2626; }
.tool-card .icon.blue { background: #dbeafe; color: #2563eb; }
.tool-card .icon.green { background: #dcfce7; color: #16a34a; }
.tool-card .icon.yellow { background: #fef3c7; color: #d97706; }
.tool-card .icon.purple { background: #ede9fe; color: #7c3aed; }
.tool-card .icon.pink { background: #fce7f3; color: #db2777; }
.tool-card .icon.indigo { background: #e0e7ff; color: #4f46e5; }
.tool-card .icon.teal { background: #ccfbf1; color: #0d9488; }
.tool-card .icon.orange { background: #ffedd5; color: #ea580c; }
.tool-card .icon.cyan { background: #cffafe; color: #0891b2; }
.tool-card .icon.gray { background: #f3f4f6; color: #4b5563; }

.tool-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--dark);
}

.tool-card p {
    color: var(--gray-600);
    font-size: 14px;
}

/* Tool Page */
.tool-container {
    max-width: 900px;
    margin: 0 auto;
}

.tool-box {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tool-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 30px;
    text-align: center;
}

.tool-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.tool-header p {
    opacity: 0.9;
}

.tool-body {
    padding: 40px;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--gray-100);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: #fff5f5;
}

.drop-zone i {
    font-size: 50px;
    color: var(--gray-400);
    margin-bottom: 20px;
}

.drop-zone h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--dark);
}

.drop-zone p {
    color: var(--gray-600);
    margin-bottom: 20px;
}

.drop-zone input[type="file"] {
    display: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-lg {
    padding: 15px 40px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* File List */
.file-list {
    margin-top: 30px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--gray-100);
    border-radius: 8px;
    margin-bottom: 10px;
}

.file-item .file-icon {
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.file-item .file-info {
    flex: 1;
}

.file-item .file-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 3px;
}

.file-item .file-size {
    font-size: 13px;
    color: var(--gray-600);
}

.file-item .file-actions {
    display: flex;
    gap: 8px;
}

.file-item .btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.file-item .btn-icon.delete {
    background: #fee2e2;
    color: #dc2626;
}

.file-item .btn-icon.delete:hover {
    background: #dc2626;
    color: white;
}

/* Preview Grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.preview-item {
    position: relative;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.preview-item img,
.preview-item canvas {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background: var(--gray-100);
}

.preview-item .page-num {
    text-align: center;
    padding: 8px;
    font-size: 13px;
    color: var(--gray-600);
    background: var(--gray-100);
}

.preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.preview-item .checkbox {
    position: absolute;
    top: 5px;
    left: 5px;
}

/* Sortable */
.preview-item.sortable-ghost {
    opacity: 0.4;
}

.preview-item.sortable-chosen {
    box-shadow: var(--shadow-lg);
}

/* Options Panel */
.options-panel {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 25px;
    margin-top: 30px;
}

.options-panel h4 {
    margin-bottom: 20px;
    color: var(--dark);
}

.option-group {
    margin-bottom: 20px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.option-group input[type="text"],
.option-group input[type="number"],
.option-group input[type="password"],
.option-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.option-group input:focus,
.option-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.option-row {
    display: flex;
    gap: 20px;
}

.option-row .option-group {
    flex: 1;
}

/* Radio/Checkbox Options */
.radio-options,
.checkbox-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-option input,
.checkbox-option input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Progress */
.progress-container {
    margin-top: 30px;
    display: none;
}

.progress-container.active {
    display: block;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: var(--gray-600);
    font-size: 14px;
}

/* Result */
.result-container {
    margin-top: 30px;
    text-align: center;
    display: none;
}

.result-container.active {
    display: block;
}

.result-success {
    background: #dcfce7;
    border-radius: var(--border-radius);
    padding: 30px;
}

.result-success i {
    font-size: 50px;
    color: var(--success);
    margin-bottom: 15px;
}

.result-success h3 {
    color: var(--dark);
    margin-bottom: 10px;
}

.result-success p {
    color: var(--gray-600);
    margin-bottom: 20px;
}

/* Actions */
.tool-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* Page Selector */
.page-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.page-selector .page-btn {
    width: 45px;
    height: 45px;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.page-selector .page-btn:hover {
    border-color: var(--primary);
}

.page-selector .page-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Range Input */
.range-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-input input {
    width: 80px;
    text-align: center;
}

.range-input span {
    color: var(--gray-600);
}

/* Alert */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fee2e2;
    color: #dc2626;
}

.alert-success {
    background: #dcfce7;
    color: #16a34a;
}

.alert-info {
    background: #dbeafe;
    color: #2563eb;
}

/* Footer */
.site-footer {
    background: var(--dark);
    color: white;
    padding: 50px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-size: 20px;
    margin-bottom: 15px;
}

.footer-brand .logo i {
    color: var(--primary);
}

.footer-brand p {
    color: var(--gray-400);
    font-size: 14px;
    line-height: 1.7;
}

.footer-links h4 {
    margin-bottom: 20px;
    font-size: 16px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 15px;
    }

    .page-header h1 {
        font-size: 26px;
    }

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

    .tool-body {
        padding: 25px;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .option-row {
        flex-direction: column;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

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

    .tool-actions .btn {
        width: 100%;
    }
}

/* Watermark Options */
.watermark-preview {
    width: 200px;
    height: 280px;
    border: 1px solid var(--gray-300);
    margin: 20px auto;
    position: relative;
    background: white;
}

.watermark-preview .watermark-text {
    position: absolute;
    font-size: 14px;
    color: rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* Color Picker */
.color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-600);
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary);
}

/* Draggable handle */
.drag-handle {
    cursor: grab;
    color: var(--gray-400);
    padding: 5px;
}

.drag-handle:active {
    cursor: grabbing;
}
