/* Okovi Inventory System - Modern 3D Design with Mobile Optimization */

:root {
    --primary-color: #8bc34a;
    --primary-dark: #689f38;
    --primary-light: #aed581;
    --secondary-color: #4a3728;
    --accent-color: #ff9800;
    --danger-color: #f44336;
    --warning-color: #ffeb3b;
    --success-color: #4caf50;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    --shadow-3d: 0 10px 25px rgba(0,0,0,0.25), 0 5px 10px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #3a2818 100%);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section img {
    height: 120px;
    width: auto;
}

.header-logo {
    height: 120px;
    width: auto;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-light);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
}

.logout-btn {
    background: var(--danger-color);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Dashboard Title Section */
.dashboard-header {
    text-align: center;
    margin: 40px 0 30px;
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

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

/* 3D Button Styles */
.btn-3d {
    display: inline-block;
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    color: white;
    background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-3d);
    position: relative;
    overflow: hidden;
}

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

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

.btn-3d:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3), 0 8px 15px rgba(0,0,0,0.2);
}

.btn-3d:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.btn-3d-secondary {
    background: linear-gradient(145deg, var(--accent-color), #f57c00);
}

.btn-3d-danger {
    background: linear-gradient(145deg, var(--danger-color), #d32f2f);
}

/* Button Container */
.button-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* 3D Search Box */
.search-container {
    max-width: 600px;
    margin: 30px auto;
}

.search-box-3d {
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow-3d);
}

.search-box-3d input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box-3d input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.2);
}

.search-box-3d button {
    padding: 12px 30px;
    background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.search-box-3d button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-3d);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
}

.stat-card h3 {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Category Cards */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
    justify-items: center;
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow-3d);
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    max-width: 320px;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 195, 74, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 45px rgba(0,0,0,0.3);
}

.category-card h3 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.category-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.category-card .item-count {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 3D Dropdown/Select */
.select-3d {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.select-3d:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.2), var(--shadow-lg);
}

.select-3d:hover {
    border-color: var(--primary-light);
}

/* Form Styles */
.form-container {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: var(--shadow-3d);
    max-width: 900px;
    margin: 30px auto;
}

.form-title {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 25px;
    text-align: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-single {
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.2);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Quantity Fields Column */
.quantity-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Alert Badges */
.alert-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.alert-critical {
    background: #ffebee;
    color: #c62828;
}

.alert-warning {
    background: #fff9c4;
    color: #f57f17;
}

.alert-ok {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-3d);
    overflow: hidden;
    margin: 30px 0;
}

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

thead {
    background: linear-gradient(135deg, var(--secondary-color), #3a2818);
    color: white;
}

thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f9f9f9;
}

tbody td {
    padding: 15px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    .logo-section img {
        height: 40px;
    }
    
    nav ul {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    nav a {
        display: block;
        width: 100%;
    }
    
    .dashboard-title {
        font-size: 1.8rem;
    }
    
    .button-container {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-3d {
        width: 100%;
        max-width: 300px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .btn-3d {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .stat-card .number {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: var(--shadow-md);
}

.message-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.message-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.message-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #2196f3;
}



/* ============================================================================
   HAMBURGER MENU (Mobile Navigation)
   ============================================================================ */

.hamburger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-menu span {
    display: block;
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================================================
   CATEGORY DETAIL PAGE
   ============================================================================ */

.category-detail-header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--shadow-3d);
    display: flex;
    gap: 30px;
    align-items: center;
}

.category-image {
    flex-shrink: 0;
}

.category-image img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.category-info {
    flex: 1;
}

.subcategory-filter {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.subcategory-filter label {
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.subcategory-filter select {
    flex: 1;
    max-width: 400px;
}

/* ============================================================================
   MOBILE RESPONSIVE UPDATES
   ============================================================================ */

@media (max-width: 768px) {
    /* Show hamburger menu */
    .hamburger-menu {
        display: flex;
    }
    
    /* Hide logo on mobile */
    .logo-section img {
        display: none;
    }
    
    /* Center title on mobile */
    .logo-section {
        justify-content: center;
        flex: 1;
    }
    
    /* Make header container relative for absolute positioning */
    header .container {
        position: relative;
    }
    
    /* Hide navigation by default on mobile */
    nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--secondary-color);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
    }
    
    nav.active {
        max-height: 400px;
    }
    
    nav ul {
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }
    
    nav li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    nav li:last-child {
        border-bottom: none;
    }
    
    nav a {
        display: block;
        padding: 15px 10px;
        width: 100%;
    }
    
    /* Category detail page mobile */
    .category-detail-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .category-image img {
        max-width: 150px;
    }
    
    .subcategory-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .subcategory-filter select {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .category-detail-header {
        padding: 15px;
    }
    
    .category-image img {
        max-width: 120px;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
}



/* ============================================================================
   FILTERS CONTAINER (for items.php)
   ============================================================================ */

.filters-container {
    margin: 20px 0;
}

.filters-container .subcategory-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filters-container .subcategory-filter label {
    margin-right: 5px;
}

.filters-container .subcategory-filter select {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

@media (max-width: 768px) {
    .filters-container .subcategory-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-container .subcategory-filter select {
        max-width: 100%;
    }
}



/* ============================================================================
   ACTION BUTTONS (Edit/Delete)
   ============================================================================ */

.action-btn {
    display: inline-block;
    padding: 6px 10px;
    margin: 0 3px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.edit-btn {
    background: #e3f2fd;
    color: #1976d2;
}

.edit-btn:hover {
    background: #1976d2;
    color: white;
    transform: scale(1.1);
}

.delete-btn {
    background: #ffebee;
    color: #c62828;
}

.delete-btn:hover {
    background: #c62828;
    color: white;
    transform: scale(1.1);
}


/* ============================================================================
   IMPROVED NAVIGATION - BIGGER FONTS AND BUTTONS
   ============================================================================ */

nav ul li a {
    font-size: 1.1rem !important;
    padding: 12px 20px !important;
    font-weight: 600 !important;
}

.action-buttons .btn,
.btn-primary,
.btn-secondary {
    font-size: 1.1rem !important;
    padding: 14px 28px !important;
    min-width: 180px !important;
}

.logo-section h1 {
    font-size: 2rem !important;
}

.header-logo {
    height: 100px !important;
}

/* Admin panel dropdown - HOVER ONLY */
nav .dropdown {
    position: relative;
}

nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    padding: 8px 0;
    margin-top: 8px;
    z-index: 2000;
    list-style: none;
}

nav .dropdown-menu li {
    margin: 0;
}

nav .dropdown-menu a {
    display: block;
    padding: 12px 20px !important;
    color: var(--text-dark) !important;
    text-decoration: none;
    font-size: 1rem !important;
}

nav .dropdown-menu a:hover {
    background: var(--primary-color);
    color: white !important;
}

nav .dropdown:hover .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.3s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
