/* Inventory Management Styles */
.inventory-header,
.products-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.inventory-header h2,
.products-header h2 {
    color: #2c3e50;
    margin: 0;
}

.inventory-header .header-actions,
.products-header .header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 1rem;
}

.inventory-header .filter-controls,
.products-header .filter-controls {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 0.75rem;
}

.inventory-header .filter-controls select,
.products-header .filter-controls select {
    flex: 1 1 200px;
    min-width: 180px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    font-family: "Sansation", sans-serif;
    font-size: 0.9rem;
}

.inventory-header .action-buttons,
.products-header .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.inventory-header .action-buttons .btn-primary,
.inventory-header .action-buttons .btn-secondary,
.inventory-header .action-buttons button,
.inventory-header .action-buttons a,
.products-header .action-buttons .btn-primary,
.products-header .action-buttons .btn-secondary,
.products-header .action-buttons button,
.products-header .action-buttons a {
    width: 100%;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-family: "Sansation", sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

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

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Product Statistics */
.inventory-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.product-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Responsive for smaller screens */
@media (max-width: 768px) {
    .inventory-stats {
        grid-template-columns: 1fr;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    .product-stats {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    font-size: 1.3rem;
}

.stat-content h3 {
    margin: 0 0 0.5rem 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 400;
}

.stat-content h2 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.6rem;
    font-weight: 700;
}

.stat-change {
    font-size: 0.8rem;
    color: #27ae60;
}

.stat-subtitle {
    font-size: 0.8rem;
    color: #95a5a6;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-card {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.action-content h4 {
    margin: 0 0 0.25rem 0;
    color: #2c3e50;
    font-size: 1rem;
}

.action-content p {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.8rem;
}

/* Products Table */
.products-table-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.table-header h3 {
    margin: 0;
    color: #2c3e50;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    color: #bdc3c7;
    font-size: 1.1rem;
}

.search-box input {
    padding: 0.5rem 0.5rem 0.5rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 250px;
    font-family: "Sansation", sans-serif;
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    background-color: #f8f9fa;
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.data-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #f1f2f6;
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.product-info strong {
    display: block;
    color: #2c3e50;
}

.product-info small {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.category-tag {
    background-color: #ecf0f1;
    color: #2c3e50;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-count {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.stock-count.in-stock {
    background-color: #d5f4e6;
    color: #27ae60;
}

.stock-count.low-stock {
    background-color: #fff3cd;
    color: #856404;
}

.stock-count.out-of-stock {
    background-color: #fadbd8;
    color: #e74c3c;
}

.stock-info .warning {
    color: #f39c12;
    font-size: 1rem;
}

.profit-margin {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.profit-margin.high {
    background-color: #d5f4e6;
    color: #27ae60;
}

.profit-margin.medium {
    background-color: #fff3cd;
    color: #856404;
}

.profit-margin.low {
    background-color: #fadbd8;
    color: #e74c3c;
}

.supplier-name {
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    background-color: #ecf0f1;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: #3498db;
    color: white;
}

.btn-icon.delete:hover {
    background-color: #e74c3c;
    color: white;
}

.btn-icon i {
    font-size: 1rem;
}

/* Pagination */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.pagination-info {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    color: #7f8c8d;
    cursor: pointer;
    font-family: "Sansation", sans-serif;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close {
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s ease;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid #ecf0f1;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: "Sansation", sans-serif;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Profit Preview */
.profit-preview {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.profit-preview h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1rem;
}

.profit-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: white;
    border-radius: 6px;
}

.profit-item span:first-child {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.profit-item span:last-child {
    color: #2c3e50;
    font-weight: 600;
}

/* Supplier Management */
.supplier-form {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ecf0f1;
}

.supplier-form h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.suppliers-list h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.supplier-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.supplier-info h5 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.supplier-info p {
    margin: 0.25rem 0;
    color: #7f8c8d;
    font-size: 0.8rem;
}

.supplier-actions {
    display: flex;
    gap: 0.5rem;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

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

.notification-error {
    background-color: #e74c3c;
}

.notification-info {
    background-color: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .inventory-header,
    .products-header {
        gap: 4vw;
        align-items: flex-start;
    }

    .inventory-header .header-actions,
    .products-header .header-actions {
        gap: 3vw;
    }

    .inventory-header .filter-controls,
    .products-header .filter-controls {
        gap: 3vw;
    }

    .inventory-header .action-buttons,
    .products-header .action-buttons {
        gap: 3vw;
    }

    .inventory-stats {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .quick-actions {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .table-header {
        flex-direction: column;
        gap: 4vw;
        align-items: flex-start;
    }

    .search-box input {
        width: 100%;
        padding: 3.2vw 3.2vw 3.2vw 9vw;
        font-size: 3.8vw;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .profit-details {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .modal-content {
        width: 92vw;
        margin: 6vw auto;
        padding: 5vw;
    }

    .action-buttons {
        flex-wrap: wrap;
        gap: 3vw;
    }

    .table-pagination {
        flex-direction: column;
        gap: 4vw;
        align-items: flex-start;
    }

    .supplier-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4vw;
    }
}

/* Action Buttons for Product Table */
.action-buttons-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    padding: 0.5rem !important;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0;
}

.action-btn i {
    font-size: 16px;
}

.action-btn:hover {
    opacity: 0.8;
}

/* Edit Button */
.edit-btn {
    background-color: #3498db;
    color: white;
}

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

/* Delete Button */
.delete-btn {
    background-color: #e74c3c;
    color: white;
}

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

/* View Button */
.view-btn {
    background-color: #27ae60;
    color: white;
}

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

/* Tooltip effect */
.action-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.action-btn:hover::after {
    opacity: 1;
}

/* Responsive adjustments for action buttons */
@media (max-width: 768px) {
    .action-buttons-cell {
        flex-direction: column;
        gap: 1.5vw;
    }

    .action-btn {
        width: 8.5vw;
        height: 8.5vw;
    }

    .action-btn i {
        font-size: 4.2vw;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Form Styles in Modal */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: "Sansation", sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Product Details View Styles */
.product-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.detail-section h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    color: #2c3e50;
    font-weight: 500;
    font-size: 1rem;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 92vw;
        margin: 8vw auto;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 4vw;
    }
}

/* Loading Spinner */
.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

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

.loading-content p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Notification Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form validation styles */
.form-group input:invalid,
.form-group textarea:invalid {
    border-color: #e74c3c;
}

.form-group input:valid,
.form-group textarea:valid {
    border-color: #27ae60;
}

/* Responsive design for statistics cards */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .stat-card {
        padding: 5vw;
    }

    .stat-icon {
        width: 12vw;
        height: 12vw;
        font-size: 4.8vw;
    }

    .stat-content h2 {
        font-size: 6vw;
    }
}

@media (max-width: 480px) {
    .stats-section {
        margin-bottom: 6vw;
    }

    .stats-grid {
        gap: 3vw;
    }

    .stat-card {
        padding: 4vw;
    }

    .stat-content h3 {
        font-size: 3.6vw;
    }

    .stat-content h2 {
        font-size: 5.4vw;
    }
}
