/* SumberAI - Modern Responsive CSS */

:root {
    --primary: #3498db;
    --secondary: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --white: #ffffff;
    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Landing Page */
.landing-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.landing-container {
    width: 100%;
    max-width: 1200px;
}

.landing-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    height: 200px;
}

.cloud-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    animation: float 20s infinite;
}

.cloud:before,
.cloud:after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50px;
}

.cloud1 {
    width: 100px;
    height: 40px;
    left: 10%;
    animation-duration: 25s;
}

.cloud2 {
    width: 120px;
    height: 50px;
    left: 50%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.cloud3 {
    width: 80px;
    height: 35px;
    left: 80%;
    animation-duration: 20s;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(50px) translateY(-20px); }
}

.app-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.app-title img {
    max-height: 150px !important;
    max-width: 400px !important;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 20px;
}

.app-title h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.app-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
}

.landing-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-bottom: 40px;
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.card-header h2 {
    color: var(--dark);
    margin-bottom: 10px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--light);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 500;
}

.auth-form label i {
    margin-right: 8px;
    color: var(--primary);
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.auth-form select:hover {
    border-color: var(--primary);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: var(--secondary);
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    color: white;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
}

/* App Info Section */
.app-info-section {
    margin: 40px 0;
    padding: 40px 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.info-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    color: white;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
}

.info-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.25);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.info-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-card p {
    line-height: 1.8;
    opacity: 0.95;
}

/* Guide Section */
.guide-section {
    margin: 40px 0;
    padding: 40px 20px;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 30px;
}

.guide-step {
    display: flex;
    gap: 25px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 15px;
    color: white;
    align-items: flex-start;
    transition: all 0.3s;
}

.guide-step:hover {
    transform: translateX(10px);
    background: rgba(255,255,255,0.25);
}

.step-number {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.step-content h3 i {
    margin-right: 10px;
    color: rgba(255,255,255,0.8);
}

.step-content p {
    line-height: 1.8;
    opacity: 0.95;
}

.landing-footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
}

/* Dashboard Layout */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--dark);
    color: white;
    padding: 20px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    -webkit-overflow-scrolling: touch;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    pointer-events: auto !important;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light);
}

.content-header h1 {
    color: var(--dark);
    margin-bottom: 5px;
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--light);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notifications-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 60px;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 20px;
    display: none;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu h3 {
    margin-bottom: 15px;
    color: var(--dark);
}

.notification-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--light);
    transition: background 0.3s;
}

.notification-item:hover {
    background: var(--light);
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.notif-icon.info { background: var(--primary); }
.notif-icon.warning { background: var(--warning); }
.notif-icon.danger { background: var(--danger); }
.notif-icon.success { background: var(--secondary); }

.notif-content strong {
    display: block;
    margin-bottom: 5px;
    color: var(--dark);
}

.notif-content p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.notif-content small {
    color: #999;
    font-size: 0.8rem;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.menu-card {
    background: white;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.menu-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.menu-card h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Tables */
.content-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.content-section h2 {
    margin-bottom: 20px;
    color: var(--dark);
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--light);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
}

.data-table td {
    padding: 15px;
    border-top: 1px solid var(--light);
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.text-center {
    text-align: center;
}

.empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Forms */
.form-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--secondary);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--primary);
}

/* Map */
#map {
    width: 100%;
    height: 500px;
    border-radius: 10px;
    margin-top: 20px;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1002;
    width: 50px;
    height: 50px;
    background: var(--dark);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    pointer-events: auto;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    touch-action: manipulation;
    align-items: center;
    justify-content: center;
}

.menu-toggle:active,
.menu-toggle:focus {
    transform: scale(0.95);
    background: rgba(52, 73, 94, 0.9);
    outline: none;
}

.menu-toggle:hover {
    background: rgba(52, 73, 94, 0.95);
}

/* Responsive */
@media (max-width: 1024px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed !important;
        top: 15px !important;
        left: 15px !important;
        z-index: 1002 !important;
        width: 45px !important;
        height: 45px !important;
        background: var(--dark) !important;
        color: white !important;
        border: none !important;
        border-radius: 8px !important;
        font-size: 1.5rem !important;
        cursor: pointer !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
        pointer-events: auto !important;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2) !important;
        touch-action: manipulation !important;
    }
    
    .sidebar {
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease-in-out !important;
        position: fixed !important;
        z-index: 1001 !important;
        height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
        display: block !important;
        width: 280px !important;
        max-width: 85vw !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .sidebar.active {
        transform: translateX(0) !important;
    }
    
    /* Pastikan sidebar muncul untuk semua role di mobile */
    .main-content[style*="margin-left: 0"] ~ .sidebar,
    body .sidebar,
    #sidebar {
        display: block !important;
        visibility: visible !important;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 15px;
        padding-top: 80px;
        width: 100%;
    }
    
    .nav-item {
        pointer-events: auto;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-item:active {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .app-title h1 {
        font-size: 2rem;
    }
    
    .landing-card {
        padding: 20px;
    }
    
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .menu-icon {
        font-size: 2.5rem;
    }
    
    .menu-card {
        padding: 20px 15px;
    }
    
    .menu-card h3 {
        font-size: 1rem;
        word-wrap: break-word;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
    
    .dropdown-menu {
        width: 100%;
        right: 0;
        left: 0;
        max-width: 100%;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin: 0 auto;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .content-section {
        padding: 20px;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    .data-table {
        font-size: 0.9rem;
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    /* Fix text overflow */
    h1, h2, h3, p {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix header right alignment */
    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .menu-icon {
        font-size: 2rem;
    }
    
    .menu-card {
        padding: 15px 10px;
    }
    
    .menu-card h3 {
        font-size: 0.9rem;
        word-wrap: break-word;
    }
    
    .app-title h1 {
        font-size: 1.5rem;
    }
    
    .landing-card {
        padding: 15px;
    }
    
    .content-section {
        padding: 15px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10% auto;
        width: 95%;
        max-width: 95%;
    }
    
    /* Ensure buttons are touch-friendly */
    .btn, .btn-icon, .menu-toggle {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Better spacing for small screens */
    .stats-grid {
        gap: 12px;
    }
    
    .menu-grid {
        gap: 10px;
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

