:root {
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --primary-bg: #eef2ff;
    --accent: #06b6d4;
    --success: #10b981;
    --success-bg: #d1fae5;
    --info: #3b82f6;
    --info-bg: #dbeafe;
    --danger: #ef4444;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tool Hero Section */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
    color: var(--text-main);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* Generator Wrapper */
.pagination-generator-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

/* Tool Cards */
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 28px;
    transition: var(--transition);
}

.tool-card:hover {
    box-shadow: var(--shadow-medium);
}

.card-header {
    margin-bottom: 24px;
}

.card-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px 0;
}

.card-description {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.card-body {
    margin-top: 0;
}

/* Configuration Grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.config-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label i {
    color: var(--primary);
    font-size: 14px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-main);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-input:hover,
.form-select:hover {
    border-color: var(--border-hover);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -4px;
}

/* Color Input */
.custom-colors-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.color-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.form-color {
    width: 60px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 2px;
    background: var(--surface);
}

.form-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.form-color::-webkit-color-swatch {
    border: none;
    border-radius: calc(var(--radius) - 2px);
}

.color-text {
    flex: 1;
    
}

/* Checkbox Styling */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border-radius: var(--radius);
    transition: var(--transition);
    user-select: none;
}

.checkbox-label:hover {
    background: var(--surface-muted);
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-muted);
    border-color: var(--border-hover);
}

.btn-icon {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    
}

.btn-icon:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.btn-icon:active {
    transform: translateY(0);
}

.btn-icon.copied {
    background: var(--success);
}

.btn-text {
    font-size: 14px;
}

/* Code Output */
.code-output {
    width: 100%;
    padding: 16px;
    font-size: 13px;
    color: var(--text-main);
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    line-height: 1.6;
    tab-size: 2;
}

.code-output:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

/* Preview Container */
.preview-container {
    padding: 32px;
    background: var(--surface-muted);
    border-radius: var(--radius);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Generated Pagination Styles */
#pagination-preview .pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
    
    flex-wrap: wrap;
    gap: 4px;
}

#pagination-preview .page-item {
    margin: 0;
}

#pagination-preview .page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    line-height: 1.25;
    color: #007bff;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
    transition: all 0.15s ease-in-out;
    border-radius: 0.25rem;
}

#pagination-preview .page-link:hover {
    z-index: 2;
    color: #0056b3;
    text-decoration: none;
    background-color: #e9ecef;
    border-color: #adb5bd;
}

#pagination-preview .page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

#pagination-preview .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: auto;
    background-color: #fff;
    border-color: #dee2e6;
}

#pagination-preview .pagination-info,
#pagination-preview .pagination-total {
    text-align: center;
    margin: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }

    .tool-card {
        padding: 20px;
    }

    .config-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .card-header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-icon {
        width: 100%;
        justify-content: center;
    }

    .preview-container {
        padding: 20px;
    }

    .code-output {
        font-size: 12px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .tool-card {
        padding: 16px;
    }

    .config-section {
        margin-top: 24px;
        padding-top: 24px;
    }

    .color-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .form-color {
        width: 100%;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    :root {
        --surface: #1e293b;
        --surface-muted: #0f172a;
        --border: #334155;
        --border-hover: #475569;
        --text-main: #f1f5f9;
        --text-muted: #94a3b8;
        --text-light: #64748b;
    }
}
