/* Enhanced Header Styles - Toko Laris Modern Design */

/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: #334155;
    padding-top: 80px;
}

/* Enhanced Header Styles */
.header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 80px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    min-width: 200px;
    background: linear-gradient(45deg, #ffffff 0%, #f1f5f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header h1::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #ffffff 0%, transparent 100%);
    border-radius: 1px;
}

.header-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    height: 44px;
    position: relative;
    min-width: 130px;
    text-align: center;
    background: transparent;
    border: 1px solid transparent;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-item:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item.active {
    color: white;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 320px;
    justify-content: flex-end;
}

.user-role {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-greeting {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    position: relative;
}

.user-greeting::before {
    content: '👋';
    margin-right: 8px;
    animation: wave 2s infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}

.logout-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    position: relative;
    overflow: hidden;
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.logout-btn:hover::before {
    left: 100%;
}

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

/* Main Content */
.main-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Menu Sections */
.menu-section {
    width: 100%;
}

/* Container dan Card Styles */
.container {
    background: rgba(255, 255, 255, 0.98);
    padding: 32px;
    border-radius: 20px;
    margin: 24px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.container:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
}

/* Menu Items */
.container h2 {
    color: #6366f1;
    margin-bottom: 32px;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    position: relative;
}

.container h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 2px;
}

.container p {
    text-align: center;
    color: #6366f1;
    margin-bottom: 24px;
    font-style: italic;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #6366f1;
    font-weight: 500;
}

/* Form Styles */
input[type="text"], 
input[type="password"], 
input[type="number"] {
    width: 100%;
    padding: 14px 18px;
    margin: 10px 0;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: white;
    transform: translateY(-1px);
}

/* Button Styles */
button {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

button:hover::before {
    left: 100%;
}

button[name="tambah_barang"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

button[name="update_stok"] {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 8px 16px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

th {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 18px;
    text-align: left;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
}

td {
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    font-weight: 500;
}

tr:hover td {
    background-color: #f8fafc;
    transform: scale(1.01);
}

tr:nth-child(even) td {
    background-color: #fafbfc;
}

/* Admin Only Section */
.admin-only {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 24px;
    margin: 24px 0;
    border-radius: 16px;
    border-left: 4px solid #f59e0b;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.admin-only h3 {
    color: #92400e;
    margin-bottom: 18px;
    font-weight: 700;
}

/* Success Message */
.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    padding: 16px 24px;
    border-radius: 12px;
    margin: 18px 0;
    border-left: 4px solid #10b981;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

/* Error Message */
.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    padding: 16px 24px;
    border-radius: 12px;
    margin: 18px 0;
    border-left: 4px solid #ef4444;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

/* Page Titles */
h2 {
    color: #6366f1;
    margin-bottom: 24px;
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    color: #374151;
    margin-bottom: 18px;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Form dalam table */
form {
    display: inline-block;
    margin: 0;
}

/* Login Form */
.login-form {
    max-width: 450px;
    margin: 120px auto 24px;
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    .header-left {
        gap: 30px;
    }
    
    .nav-item {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 110px;
    }
    
    .header h1 {
        font-size: 1.3rem;
        min-width: 180px;
    }
    
    .header-right {
        min-width: 280px;
    }
}

@media (max-width: 992px) {
    .header-content {
        padding: 0 20px;
    }
    
    .header-left {
        gap: 20px;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 90px;
    }
    
    .header-right {
        min-width: 240px;
        gap: 12px;
    }
    
    .user-greeting {
        font-size: 13px;
    }
    
    .logout-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 140px;
    }
    
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 20px;
        gap: 20px;
    }
    
    .header-left {
        flex-direction: column;
        gap: 20px;
        width: 100%;
        text-align: center;
    }
    
    .header-menu {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 8px;
        padding: 12px;
    }
    
    .nav-item {
        height: 40px;
        padding: 8px 12px;
        font-size: 12px;
        min-width: 85px;
    }
    
    .header-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        min-width: auto;
        width: 100%;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .container {
        padding: 24px;
        margin: 16px 0;
    }
    
    .container h2 {
        font-size: 1.6rem;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 12px 8px;
    }
    
    .header h1 {
        font-size: 1.4rem;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 16px;
    }
    
    .nav-item {
        min-width: 75px;
        font-size: 11px;
        padding: 6px 8px;
    }
    
    .container {
        padding: 20px;
    }
    
    .container h2 {
        font-size: 1.4rem;
    }
    
    input[type="text"], 
    input[type="password"], 
    input[type="number"] {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    button {
        padding: 12px 20px;
        font-size: 14px;
    }
}