/* ============================================
   FEMTOBIOTICS PRODUCTS MODULE - CSS
   ============================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1f3b73;
    --primary-hover: #1b2f5b;
    --secondary-color: #0ea5e9;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
    --bg-color: #1f3b73;
    --card-bg: #ffffff;
    --border-color: #d9e7ea;
    --text-primary: #111827;
    --text-secondary: #64748b;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.18);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.24);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1f2937 100%);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 24px;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 60%),
        url('../icons/LuminoTec%20Logo.png') center/ min(80vw, 800px) no-repeat;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 32px 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header h1 {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 300;
    letter-spacing: 0.5px;
    font-family: "Segoe UI","Inter","Roboto","Helvetica Neue",Arial,sans-serif;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: rgba(255,255,255,0.95);
    font-size: 1.15rem;
    font-weight: 400;
}

/* Form Section */
.form-section {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.form-section:hover {
    box-shadow: var(--shadow-xl);
}

.form-section h2 {
    font-size: 1.5rem;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    resize: vertical;
    font-family: inherit;
}

.error-message {
    display: block;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 6px;
    min-height: 20px;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(75, 85, 99, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(75, 85, 99, 0.4);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* List Section */
.list-section {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.list-section:hover {
    box-shadow: var(--shadow-xl);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 20px;
}

.list-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.search-box input {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    min-width: 250px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Table */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background-color: var(--bg-color);
}

th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 2px solid rgba(255,255,255,0.25);
}

/* Rounded corners for header row */
thead th { background: var(--bg-color); }
thead th:first-child { border-top-left-radius: 12px; }
thead th:last-child { border-top-right-radius: 12px; }

td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f1f5f9;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    margin-right: 6px;
    transition: all 0.2s;
}

.edit-btn {
    background-color: var(--primary-color);
    color: white;
}

.edit-btn:hover {
    background-color: var(--primary-hover);
}

.delete-btn {
    background-color: var(--danger-color);
    color: white;
}

.delete-btn:hover {
    background-color: var(--danger-hover);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal-content p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.product-name-preview {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions .btn {
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .form-section,
    .list-section {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box input {
        width: 100%;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 8px 6px;
    }

    .action-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
        margin-right: 4px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    /* Stack table for mobile */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px;
    }

    td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    td:before {
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        content: attr(data-label);
    }

    td:last-child {
        text-align: center;
        padding-left: 10px;
    }

    .action-btn {
        margin: 4px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}
