/* Automations Page - Dark Mode Support */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root[data-theme="light"] {
    --primary: #1E3A8A;
    --primary-light: #3B82F6;
    --secondary: #64748B;
    --success: #10B981;
    --bg: #F8FAFC;
    --white: #FFFFFF;
    --text: #0F172A;
    --text-light: #64748B;
    --border: #E2E8F0;
    --shadow: rgba(0, 0, 0, 0.1);
}

:root[data-theme="dark"] {
    --primary: #60A5FA;
    --primary-light: #3B82F6;
    --secondary: #94A3B8;
    --success: #34D399;
    --bg: #0F172A;
    --white: #1E293B;
    --text: #F1F5F9;
    --text-light: #CBD5E1;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo i {
    font-size: 1.75rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: 0.2s;
}

.nav a:hover,
.nav a.active {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9375rem;
    cursor: pointer;
}

.theme-toggle {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Search Section */
.search-section {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.clear-search {
    position: absolute;
    right: 1rem;
    color: var(--text-light);
    text-decoration: none;
}

.btn-search {
    padding: 0.875rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Main */
.main {
    padding: 2rem 0 4rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Sidebar */
.sidebar-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 100px;
}

.sidebar-card h3 {
    margin-bottom: 1rem;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: 0.2s;
}

.category-list a:hover,
.category-list a.active {
    background: var(--primary);
    color: white;
}

.cat-icon {
    font-size: 1.25rem;
}

.count {
    margin-left: auto;
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.category-list a.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Content */
.results-header {
    margin-bottom: 2rem;
}

.automation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.automation-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: 0.3s;
}

.automation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.category-badge,
.trigger-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.category-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.trigger-badge {
    background: rgba(30, 58, 138, 0.1);
    color: var(--primary);
}

.automation-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.automation-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-bottom: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-light);
}

.stats {
    display: flex;
    gap: 1rem;
}

.date {
    font-size: 0.8125rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
}

.btn:hover {
    background: var(--primary-light);
}

.btn-block {
    width: 100%;
}

.btn-secondary {
    background: var(--secondary);
}

.btn-primary {
    background: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
}

.empty-state i {
    font-size: 5rem;
    color: var(--text-light);
    opacity: 0.5;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

.page-info {
    font-weight: 600;
    color: var(--text-light);
}

/* Footer */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h4 {
    margin-bottom: 1rem;
}

.footer p {
    color: var(--text-light);
    line-height: 1.8;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
    }

    .nav {
        gap: 1rem;
        order: 3;
        width: 100%;
    }

    .search-form {
        flex-direction: column;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-card {
        position: static;
    }

    .automation-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}