/* Color Palette */
:root {
    --primary-color: #4f46e5; /* Indigo */
    --primary-dark: #4338ca;
    --secondary-color: #22c55e; /* Green for success/download */
    --secondary-dark: #16a34a;
    --danger-color: #ef4444; /* Red for delete */
    --danger-dark: #dc2626;
    --text-color: #333;
    --light-text-color: #666;
    --background-color: #f8faff;
    --panel-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.main-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
}

.panel {
    background: var(--panel-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-light);
    flex: 1;
    min-width: 380px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow-medium);
}

h1, h2, h3 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

h2 i, h1 i {
    color: var(--primary-color);
    font-size: 1.2em;
}

p.panel-description {
    text-align: center;
    color: var(--light-text-color);
    margin-bottom: 30px;
    font-size: 0.95em;
}

.message-container {
    margin-bottom: 20px;
    text-align: center;
}

.alert {
    padding: 12px 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 0.95em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error, .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.close-btn {
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 1;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

form p {
    text-align: left;
    margin-bottom: 0;
}

form label {
    margin-top: 0;
    font-weight: 600;
    color: var(--text-color);
    display: block;
    margin-bottom: 5px;
}

input[type="file"],
select,
textarea {
    margin-top: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: calc(100% - 24px);
    background-color: #fdfdff;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

input[type="file"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    outline: none;
}

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    margin-right: 15px;
    font-weight: 400;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.submit-button {
    margin-top: 30px;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: none;
}

table {
    width: 100%;
    margin-top: 25px;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel-bg);
    box-shadow: 0 2px 10px var(--shadow-light);
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: var(--primary-color);
    color: #fff;
}

th, td {
    padding: 15px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

th:first-child { border-top-left-radius: 10px; }
th:last-child { border-top-right-radius: 10px; }

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

tbody tr:nth-child(even) {
    background: #fdfdfd;
}

tbody tr:hover {
    background-color: #eef2ff;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.action-link, .action-button {
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.3s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.download-link {
    background: var(--secondary-color);
    color: #fff;
}

.download-link:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
}

.delete-btn {
    background: var(--danger-color);
    color: #fff;
    border: none;
    cursor: pointer;
}

.delete-btn:hover {
    background: var(--danger-dark);
    transform: translateY(-1px);
}

.edit-link {
    background: var(--primary-color);
    color: #fff;
}

.edit-link:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.no-data {
    text-align: center;
    padding: 20px;
    color: var(--light-text-color);
    font-style: italic;
}

ul {
    list-style: none;
    padding: 0;
    text-align: center;
}

ul li {
    margin: 10px 0;
}

ul li a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

ul li a:hover {
    text-decoration: underline;
}

@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }

    .panel {
        width: 95%;
        max-width: 600px;
        margin-bottom: 20px;
    }
    
    body {
        padding: 20px 10px;
    }
}

@media (max-width: 576px) {
    .panel {
        min-width: unset;
        width: 100%;
    }
    th, td {
        padding: 10px 8px;
        font-size: 0.9em;
    }
    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }
    .action-link, .action-button {
        width: 100%;
        justify-content: center;
    }
}