/**
 * Custom Styles for Inventory Management System
 * Built on Bootstrap 3.3.7
 */

/* General Styles */
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-top: 50px;
}

.login-box h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.login-form {
    margin-top: 30px;
}

/* Main Content */
.main-content {
    margin-top: 70px;
    padding: 20px;
}

/* Navigation */
.navbar-inverse {
    background-color: #2c3e50;
    border-color: #1a252f;
}

.navbar-inverse .navbar-brand {
    color: #fff;
    font-weight: bold;
    font-size: 20px;
}

.navbar-inverse .navbar-brand:hover {
    color: #3498db;
}

.navbar-inverse .navbar-nav > li > a {
    color: #ecf0f1;
}

.navbar-inverse .navbar-nav > li > a:hover {
    color: #3498db;
}

.navbar-inverse .navbar-nav > .active > a {
    background-color: #34495e;
}

.navbar-text {
    color: #ecf0f1 !important;
}

/* Panels */
.panel {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 5px;
}

.panel-heading {
    border-radius: 5px 5px 0 0;
}

.panel-primary > .panel-heading {
    background-color: #3498db;
    border-color: #3498db;
}

.panel-default > .panel-heading {
    background-color: #ecf0f1;
    color: #2c3e50;
}

/* Tables */
.table-responsive {
    margin-top: 20px;
}

.table > thead > tr > th {
    background-color: #34495e;
    color: white;
    border: none;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #f9f9f9;
}

.table-hover > tbody > tr:hover {
    background-color: #e8f4f8;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #3498db !important;
    color: white !important;
    border-color: #3498db !important;
}

/* Buttons */
.btn {
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

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

.btn-success {
    background-color: #27ae60;
    border-color: #27ae60;
}

.btn-success:hover {
    background-color: #229954;
    border-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
}

/* Action Buttons */
.action-buttons {
    white-space: nowrap;
}

.action-buttons .btn {
    margin-right: 5px;
}

/* Field list action buttons */
.list-group-item .pull-right .btn {
    margin-left: 3px;
}

/* List Switcher Dropdown */
.list-dropdown .list-color-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.list-dropdown .dropdown-menu .list-color-indicator {
    width: 10px;
    height: 10px;
}

.list-dropdown .dropdown-menu > li > a {
    padding: 8px 20px;
}

.list-dropdown .dropdown-menu > li.active > a {
    background-color: #f5f5f5;
    color: #333;
    font-weight: bold;
}

.list-dropdown .list-name {
    max-width: 150px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .list-dropdown .list-name {
        max-width: 100px;
    }
}

/* List indicator in settings */
.well .list-color-indicator {
    vertical-align: middle;
}

.well .dropdown {
    margin-top: -3px;
}

.well .row {
    margin: 0;
}

@media (max-width: 768px) {
    .well .text-right {
        text-align: left !important;
        margin-top: 10px;
    }
}

/* Sortable Fields */
#sortable-fields {
    list-style: none;
    padding: 0;
}

#sortable-fields li {
    cursor: move;
    margin-bottom: 10px;
    border-left: 3px solid #3498db;
    touch-action: none; /* Enable touch support for drag */
}

#sortable-fields li:hover {
    background-color: #f0f8ff;
}

#sortable-fields li.ui-sortable-helper {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #fff;
    opacity: 0.9;
}

.drag-handle {
    cursor: move;
    padding: 5px;
    touch-action: none; /* Enable touch support */
}

/* Improve touch target size for mobile */
@media (max-width: 768px) {
    .drag-handle {
        font-size: 18px;
        padding: 10px;
    }
    
    #sortable-fields li {
        padding: 15px 10px;
    }
}

/* Photo Management */
.photo-item {
    margin-bottom: 15px;
}

.photo-item .thumbnail {
    margin-bottom: 0;
    transition: transform 0.2s;
}

.photo-item .thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.photo-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.thumbnail .caption {
    padding: 5px;
}

/* Upload Progress */
#upload-progress .progress {
    margin-bottom: 0;
}

/* Alerts */
.alert {
    border-radius: 5px;
    border: none;
}

.alert-dismissible .close {
    top: -5px;
}

/* Form Enhancements */
.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}

label {
    font-weight: 600;
    color: #2c3e50;
}

/* Page Header */
.page-header {
    border-bottom: 2px solid #3498db;
    margin-top: 0;
}

.page-header h1 {
    margin-top: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .main-content {
        margin-top: 60px;
        padding: 10px;
    }
    
    .login-box {
        padding: 20px;
    }
    
    .navbar-nav {
        margin: 0;
    }
    
    .action-buttons .btn {
        margin-bottom: 5px;
    }
    
    .photo-item {
        margin-bottom: 10px;
    }
    
    .page-header h1 .btn {
        margin-top: 10px;
        display: block;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .table-responsive {
        border: 0;
    }
    
    .table-responsive table {
        font-size: 12px;
    }
    
    .btn-sm {
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 20px;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Labels */
.label {
    font-size: 85%;
    padding: .3em .6em;
}

/* Thumbnails in Tables */
.table .img-thumbnail {
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 2px;
}

/* Help Text */
.help-block {
    color: #7f8c8d;
    font-size: 90%;
}

/* Panel Utilities */
.panel-body {
    padding: 20px;
}

/* Custom Checkbox/Radio Styles */
.checkbox label,
.radio label {
    padding-left: 20px;
    font-weight: normal;
}

/* Utility Classes */
.text-bold {
    font-weight: bold;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

