/**
 * Altitude Inventory - Custom Styles
 * Based on Altitude Komputer theme
 */

:root {
    --altitude-primary: #2c3e50;
    --altitude-secondary: #3498db;
    --altitude-success: #27ae60;
    --altitude-danger: #e74c3c;
    --altitude-warning: #f39c12;
    --altitude-info: #16a085;
    --altitude-dark: #1a252f;
    --altitude-light: #ecf0f1;
    --altitude-sidebar-width: 260px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: #f5f6fa;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

/* Sidebar */
.sidebar {
    position: fixed;
    width: var(--altitude-sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--altitude-dark) 0%, var(--altitude-primary) 100%);
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

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

.sidebar .sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .sidebar-brand i {
    font-size: 1.5rem;
}

.sidebar-nav {
    padding: 15px 0;
}

.sidebar-nav .nav-section {
    padding: 8px 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
    margin-top: 15px;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 3px 10px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background-color: var(--altitude-secondary);
    color: #fff;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 24px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.sidebar-footer .user-info {
    color: #fff;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-footer .user-info i {
    font-size: 1.5rem;
}

/* Main Content */
.main-content {
    margin-left: var(--altitude-sidebar-width);
    min-height: 100vh;
    padding: 25px 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--altitude-primary);
}

.page-header h1 i {
    margin-right: 10px;
    color: var(--altitude-secondary);
}

/* Cards */
.card-altitude {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-altitude:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.12);
}

.card-altitude .card-header {
    background: transparent;
    border-bottom: 1px solid #eee;
    padding: 18px 20px;
    font-weight: 600;
    color: var(--altitude-primary);
}

.card-altitude .card-header i {
    margin-right: 8px;
    color: var(--altitude-secondary);
}

/* Stat Cards */
.stat-card {
    padding: 24px;
    border-radius: 12px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255,255,255,0.1);
    transform: rotate(30deg);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    position: relative;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0 5px;
}

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

.stat-card.primary {
    background: linear-gradient(135deg, var(--altitude-primary), #3d566e);
}

.stat-card.success {
    background: linear-gradient(135deg, var(--altitude-success), #2ecc71);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--altitude-warning), #e67e22);
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--altitude-danger), #c0392b);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--altitude-info), #1abc9c);
}

/* Buttons */
.btn-altitude {
    background-color: var(--altitude-secondary);
    border-color: var(--altitude-secondary);
    color: #fff;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
}

.btn-altitude:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    color: #fff;
}

.btn-outline-altitude {
    color: var(--altitude-secondary);
    border-color: var(--altitude-secondary);
}

.btn-outline-altitude:hover {
    background-color: var(--altitude-secondary);
    color: #fff;
}

/* Tables */
.table-altitude {
    border-collapse: separate;
    border-spacing: 0;
}

.table-altitude thead th {
    background-color: var(--altitude-primary);
    color: #fff;
    font-weight: 600;
    border: none;
    padding: 15px;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-altitude thead th:first-child {
    border-radius: 8px 0 0 8px;
}

.table-altitude thead th:last-child {
    border-radius: 0 8px 8px 0;
}

.table-altitude tbody tr {
    transition: background-color 0.2s;
}

.table-altitude tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.08);
}

.table-altitude td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

/* Badges */
.badge-status {
    padding: 6px 12px;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-ready {
    background-color: var(--altitude-success);
}

.badge-sold {
    background-color: var(--altitude-danger);
}

.badge-reserved {
    background-color: var(--altitude-warning);
}

.badge-keep {
    background-color: var(--altitude-info);
}

.badge-retur {
    background-color: #9b59b6;
}

.badge-bermasalah {
    background-color: #e74c3c;
}

/* Forms */
.form-altitude .form-control,
.form-altitude .form-select {
    border-radius: 8px;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-altitude .form-control:focus,
.form-altitude .form-select:focus {
    border-color: var(--altitude-secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-altitude label {
    font-weight: 600;
    color: var(--altitude-primary);
    margin-bottom: 6px;
}

.form-altitude label.required::after {
    content: ' *';
    color: var(--altitude-danger);
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

.search-box input {
    padding-left: 45px;
}

/* Filter Section */
.filter-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #adb5bd;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 10px;
    color: #6c757d;
}

/* Alerts */
.alert-altitude {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
}

.alert-altitude.success {
    background-color: #d4edda;
    color: #155724;
}

.alert-altitude.warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-altitude.danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Product Card */
.product-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.product-card img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.product-card .card-body {
    padding: 20px;
}

.product-card .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--altitude-success);
}

/* Modal Styles */
.modal-altitude .modal-content {
    border: none;
    border-radius: 15px;
}

.modal-altitude .modal-header {
    border-bottom: 1px solid #eee;
    padding: 20px 25px;
}

.modal-altitude .modal-body {
    padding: 25px;
}

.modal-altitude .modal-footer {
    border-top: 1px solid #eee;
    padding: 15px 25px;
}

/* Sidebar Toggle (Mobile) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--altitude-secondary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

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

    .sidebar-toggle {
        display: block;
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--altitude-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* Utility Classes */
.text-altitude {
    color: var(--altitude-secondary) !important;
}

.bg-altitude {
    background-color: var(--altitude-primary) !important;
}

.bg-altitude-dark {
    background-color: var(--altitude-dark) !important;
}
