/* ========== GENERAL CRUD STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

/* ========== HEADINGS ========== */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    border-bottom: 3px solid #007bff;
    padding-bottom: 15px;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
}

/* ========== BUTTONS ========== */
.btn, button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease-in-out;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #545b62);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #545b62, #3d444d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496, #0c5460);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #333;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ff9800, #e68900);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34, #1c7430);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    margin-bottom: 10px;
}

/* ========== LINKS ========== */
a {
    color: #007bff;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* ========== FORMS ========== */
.form-group, .mb-3 {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease-in-out;
    background-color: #fff;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background-color: #f9f9f9;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

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

.form-row.full {
    grid-template-columns: 1fr;
}

/* ========== CARDS ========== */
.card {
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 25px;
}

.card-footer {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
}

/* ========== TABLES ========== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

thead {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border: none;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

tbody tr {
    transition: all 0.2s ease-in-out;
}

tbody tr:hover {
    background-color: #f5f9ff;
    transform: scale(1.01);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ========== ALERTS & MESSAGES ========== */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-danger, .alert-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.invalid-feedback, .error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
}

/* ========== IMAGE PREVIEW ========== */
.image-preview-container {
    margin-top: 15px;
    display: none;
}

.image-preview-container.show {
    display: block;
}

.img-thumbnail {
    max-width: 300px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 5px;
}

/* ========== ACTION BUTTONS ========== */
.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.actions a, .actions button {
    margin: 0;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ========== DETAILS PAGE ========== */
.detail-item {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid #007bff;
    border-radius: 4px;
}

.detail-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.detail-value {
    color: #555;
    font-size: 1.05rem;
}

/* ========== GRID LAYOUT ========== */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.col-1, .col-2, .col-3, .col-4, .col-5, .col-6 {
    display: flex;
    flex-direction: column;
}

.col-6 {
    grid-column: span 1;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 8px;
    }
    
    .actions {
        flex-direction: column;
    }
}

/* ========== UTILITY CLASSES ========== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

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

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

.p-4 {
    padding: 20px;
}

.shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.border-0 {
    border: none;
}

.rounded {
    border-radius: 6px;
}

.fw-bold {
    font-weight: 600;
}

.text-muted {
    color: #999;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

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

.align-items-center {
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}
