/* Products Module - Table styling like Users table */

.page-container {
    padding: 30px;
}

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

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

.content-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e8ecef;
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.card-body {
    padding: 0;
}

.table-wrapper {
    overflow-x: auto;
}

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

.data-table thead {
    background: #f7fafc;
}

.data-table th {
    padding: 12px 20px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e8ecef;
    font-size: 0.9rem;
}

.th-sortable {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.th-sortable:hover {
    color: #2d5a27;
}

.sort-icon {
    font-size: 0.85rem;
    color: #a0aec0;
    transition: color 0.2s ease;
}

.sort-icon.active {
    color: #2d5a27;
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #e8ecef;
    color: #5a6c7d;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--bg-light);
    color: var(--primary-green);
}

.action-btn.text-danger {
    color: var(--status-red);
}

.action-btn.text-danger:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--status-red);
}

/* Legacy styles - kept for compatibility */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f0f3f7;
    color: #2c3e50;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-edit { 
    color: #2d5a27;
}

.btn-delete { 
    color: #e74c3c;
}

.loading {
    text-align: center;
    color: #718096;
    padding: 40px 20px;
}

.no-data {
    text-align: center;
    color: #718096;
    padding: 30px 20px;
}

.product-link {
    color: #2d5a27;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.product-link:hover {
    color: #1a3317;
    text-decoration: underline;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: background 0.4s ease, opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
    perspective: 1200px;
}

.modal.active {
    visibility: visible;
    opacity: 1;
    background: rgba(0,0,0,0.6);
    pointer-events: auto;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    transform: rotateX(-90deg);
    transform-origin: top center;
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
}

.modal.active .modal-content {
    transform: rotateX(0deg);
    opacity: 1;
}

/* Animacja zamykania - flip w dół */
.modal.closing .modal-content {
    transform: rotateX(90deg);
    transform-origin: bottom center;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.55, 0.055, 0.675, 0.19), opacity 0.3s ease;
}

.modal-small {
    max-width: 450px;
}

.warning-text {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 8px;
    font-weight: 500;
}

/* Ukryj strzałki w polu VAT */
#productVatRate::-webkit-outer-spin-button,
#productVatRate::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#productVatRate {
    -moz-appearance: textfield;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e8ecef;
    background: #f7fafc;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.close-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #2c3e50;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

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

.form-row .full-width {
    grid-column: 1 / -1;
}

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

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

.form-group input {
    padding: 10px 14px;
    border: 1px solid #e8ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #2c3e50;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #2d5a27;
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.form-group input.readonly {
    background: #f7fafc;
    color: #5a6c7d;
    cursor: default;
}

.form-group input[readonly] {
    background: #f7fafc;
    color: #5a6c7d;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e8ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f7fafc;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2d5a27 0%, #4a9142 100%);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e3d1a 0%, #2d5a27 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #2d5a27 0%, #4a9142 100%);
    color: #fff;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e3d1a 0%, #2d5a27 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.3);
}

.btn-secondary {
    background: #e8ecef;
    color: #2c3e50;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    color: #2c3e50;
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-info {
    border-left: 4px solid #3b82f6;
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-error {
    border-left: 4px solid #ef4444;
}
