/* ========================================
   CRUD CSS - Consolidated Styles for Materials Management
   ======================================== */

/* ========================================
   HEADER STYLES
   ======================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* ========================================
   SEARCH SECTION
   ======================================== */
.search-section {
    margin-bottom: 2rem;
}

.search-form {
    max-width: 800px;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 0;
    height: 2.5rem;
    box-sizing: border-box;
}

/* ========================================
   STATS SECTION
   ======================================== */
.materials-stats,
.processes-stats {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* ========================================
   TABLE STYLES
   ======================================== */
.materials-table-container,
.processes-table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.materials-table,
.processes-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.materials-table th,
.materials-table td,
.processes-table th,
.processes-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.materials-table th,
.processes-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.materials-table tr:hover,
.processes-table tr:hover {
    background-color: #f8f9fa;
}

.actions {
    white-space: nowrap;
    width: 120px;
    text-align: center;
}

.actions .btn {
    margin-right: 0.25rem;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-info {
    margin: 0 1rem;
    font-weight: bold;
}

/* ========================================
   NO RESULTS
   ======================================== */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* ========================================
   DETAIL STYLES
   ======================================== */
.material-detail,
.process-detail {
    max-width: 800px;
    margin: 0 auto;
}

.material-info,
.process-info {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.info-section {
    padding: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.info-section:last-child {
    border-bottom: none;
}

.info-section h3 {
    margin: 0 0 1.5rem 0;
    color: #333;
    font-size: 1.25rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 1.1rem;
    color: #333;
}

.price {
    color: #28a745;
    font-weight: bold;
}

.price-highlight {
    color: #007bff;
    font-weight: bold;
    font-size: 1.2rem;
}

.material-actions,
.process-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* ========================================
   FORM STYLES
   ======================================== */
.material-form-container,
.process-form-container {
    max-width: 600px;
    margin: 0 auto;
}

.material-form,
.process-form {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
}

.form-section {
    /* margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0; */
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    margin: 0 0 1.5rem 0;
    color: #333;
    font-size: 1.25rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.875rem;
}

.info-display {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

/* ========================================
   DELETE CONFIRMATION STYLES
   ======================================== */
.delete-confirmation {
    max-width: 600px;
    margin: 0 auto;
}

.warning-message {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.warning-message h2 {
    color: #856404;
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.warning-message p {
    color: #856404;
    margin: 0;
    font-size: 1.1rem;
}

.material-info h3 {
    margin: 0 0 1.5rem 0;
    color: #333;
    font-size: 1.25rem;
    border-bottom: 2px solid #dc3545;
    padding-bottom: 0.5rem;
}

.confirmation-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.delete-form {
    display: inline;
}

.warning-note {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
}

.warning-note p {
    margin: 0;
    color: #721c24;
}

/* ========================================
   BUTTON STYLES
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.2s;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Icon-only buttons for table actions */
.actions .btn-sm {
    padding: 0.25rem;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-right: 0.25rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.actions .btn-sm:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Button Colors */
.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

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

.btn-search {
    background-color: #28a745;
    color: white;
}

.btn-clear {
    background-color: #6c757d;
    color: white;
}

/* Icon-only buttons for search */
.btn-icon-only {
    padding: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    box-sizing: border-box;
}

.btn-icon-only:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .header-actions {
        justify-content: center;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .material-actions,
    .process-actions {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .material-form,
    .process-form {
        padding: 1rem;
    }

    .confirmation-actions {
        flex-direction: column;
    }

    .warning-message,
    .material-info {
        padding: 1rem;
    }
}
