:root {
    --bg-color: #1A0D0D;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #D63031;
    --primary-hover: #b82929;
    --secondary: #FF7675;
    --accent: #FDCB6E;
    --text-main: #FFFFFF;
    --text-muted: #B2BEC3;
    --danger: #e74c3c;
    --success: #27ae60;
    --transition: all 0.3s ease;
    --radius: 12px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(214, 48, 49, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(253, 203, 110, 0.05) 0%, transparent 50%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo h1 span {
    color: var(--primary);
}

.primary-icon {
    color: var(--primary);
    width: 40px;
    height: 40px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Layout */
.generator-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
}

@media (max-width: 968px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
}

/* Components */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-header i {
    color: var(--secondary);
    width: 20px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.section-header .actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.section-divider {
    height: 1px;
    background: var(--card-border);
    margin: 2rem 0;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    width: 18px;
    color: var(--text-muted);
}

input[type="url"],
input[type="text"],
select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

.input-wrapper input,
.input-wrapper select {
    padding-left: 3rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Groups and Rules */
.groups-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.ua-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.25rem;
}

.group-controls {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.group-controls .form-group {
    flex: 1;
    margin-bottom: 0;
}

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rule-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rule-type {
    width: 120px !important;
    font-size: 0.9rem;
}

.rule-path {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-secondary {
    background: transparent;
    border: 1px dashed var(--secondary);
    color: var(--secondary);
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 118, 117, 0.1);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 6px;
}

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

.btn-danger-icon {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-danger-icon:hover {
    color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Preview */
.preview-panel {
    display: flex;
    flex-direction: column;
    max-height: 800px;
}

.preview-container {
    background: #0D0606;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--accent);
    white-space: pre-wrap;
    word-break: break-all;
}

.seo-tips {
    background: rgba(253, 203, 110, 0.05);
    border: 1px solid rgba(253, 203, 110, 0.2);
    border-radius: 10px;
    padding: 1.25rem;
}

.seo-tips h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.seo-tips ul {
    list-style: none;
}

.seo-tips li {
    font-size: 0.85rem;
    color: var(--text-muted);
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.25rem;
}

.seo-tips li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
