/* ===========================================
   Analisis Retail Apriori NTB
   Color Scheme: Red (#DC2626) & White
   =========================================== */

:root {
    --primary: #DC2626;
    --primary-dark: #B91C1C;
    --primary-light: #EF4444;
    --primary-lighter: #FEE2E2;
    --secondary: #FFFFFF;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --background: #F9FAFB;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --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: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ===========================================
   Buttons
   =========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(220, 38, 38, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(220, 38, 38, 0.5);
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

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

.btn-danger:hover {
    background: #DC2626;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* ===========================================
   Landing Page
   =========================================== */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo span {
    color: var(--text-dark);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    color: white;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

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

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

.hero-buttons .btn-secondary {
    border-color: white;
    color: white;
}

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

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-visual {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.hero-visual img {
    width: 100%;
    border-radius: 10px;
}

/* Stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Sections */
.section {
    padding: 5rem 0;
}

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

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.section-header h2 span {
    color: var(--primary);
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-lighter);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-light);
}

/* Algorithm Section */
.algorithm-section {
    background: linear-gradient(135deg, var(--primary-lighter) 0%, white 100%);
}

.algorithm-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.algorithm-steps {
    list-style: none;
}

.algorithm-steps li {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.step-content p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* NTB Section */
.ntb-section {
    background: var(--text-dark);
    color: white;
}

.ntb-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.ntb-content h2 {
    color: white;
}

.ntb-content h2 span {
    color: var(--primary-light);
}

.ntb-list {
    list-style: none;
    margin-top: 1.5rem;
}

.ntb-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.ntb-list li::before {
    content: '✓';
    color: var(--primary-light);
    font-weight: bold;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

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

.footer p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ===========================================
   Auth Pages
   =========================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 3rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-light);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-lighter);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ===========================================
   Admin Layout
   =========================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 0.5rem;
    padding: 0 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    margin-bottom: 0.25rem;
    transition: all 0.3s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-link svg {
    width: 20px;
    height: 20px;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    background: var(--background);
}

.admin-header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user-name {
    font-weight: 600;
}

.admin-content {
    padding: 2rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    color: var(--text-dark);
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.products {
    background: var(--primary-lighter);
    color: var(--primary);
}

.stat-icon.transactions {
    background: #DBEAFE;
    color: #2563EB;
}

.stat-icon.rules {
    background: #D1FAE5;
    color: #059669;
}

.stat-info h3 {
    font-size: 1.75rem;
    color: var(--text-dark);
}

.stat-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background: var(--background);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: white;
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--primary-lighter);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .active span {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
}

/* Apriori Results */
.rule-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.rule-items {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rule-antecedent, .rule-consequent {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-tag {
    background: var(--primary-lighter);
    color: var(--primary);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.rule-arrow {
    font-size: 1.25rem;
    color: var(--primary);
}

.rule-consequent .item-tag {
    background: #D1FAE5;
    color: #065F46;
}

.rule-metrics {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.metric {
    text-align: center;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        display: none;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .algorithm-content, .ntb-content {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

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

    .admin-content {
        padding: 1rem;
    }

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

    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .table th, .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .rule-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
