/* Define global color palette using CSS variables */

:root {
    --color-primary: #2b9bc4;
    --color-primary-dark: #1d84a9;
    --color-secondary: #6c757d;
    --color-secondary-dark: #5a6268;
    --color-background: #f8f9fa;
    --color-foreground: #ffffff;
    --color-text: #333333;
    --color-border: #ddd;
    --color-success-bg: #d4edda;
    --color-success-text: #02323d;
    --color-success-border: #e5f4f8;
    --color-error-bg: #f8d7da;
    --color-error-text: #721c24;
    --color-error-border: #f5c6cb;
    --color-warning-bg: #e17055;
    --color-warning-dark: #c46148;
    --color-item-bg: #f1f1f1;
    --color-item-border: #ccc;
    --color-table-header-bg: #f1f1f1;
    /* Reused color */
    --color-hidden-bg: #f9f9f9;
    /* Reused color */
}


/* Base styles */

a {
    cursor: pointer;
    transition: color 0.3s ease;
}

body {
    font-family: "Inter", sans-serif;
    line-height: 1.5;
    background-color: var(--color-background);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px;
    background-color: var(--color-foreground);
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: var(--color-text);
}

h2 {
    margin-top: 32px;
    margin-bottom: 12px;
    text-align: center;
    color: var(--color-text);
}

label {
    padding-left: 4px;
}


/* Form styles */

form {
    display: flex;
    flex-direction: column;
}

input,
textarea,
select {
    padding: 12px;
    margin-top: 5px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

textarea {
    resize: none;
    min-height: 64px;
    font-family: inherit;
}

.item-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 12px;
    align-items: stretch;
}

.item-field input {
    flex-grow: 1;
}


/* Filter styles */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    flex-direction: column;
}

.filter {
    display: flex;
    flex-direction: column;
    align-content: center;
}

.filter label {
    margin-right: 5px;
}


/* Button styles */

button,
a.button {
    width: 100%;
    padding: 12px 20px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    font-size: 16px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

button:hover,
a.button:hover {
    background-color: var(--color-primary-dark);
}

.delete-button {
    margin-top: 16px;
    background-color: var(--color-warning-bg);
    transition: background-color 0.3s ease;
}

.delete-button:hover {
    background-color: var(--color-warning-dark);
}

.publish-button {
    font-weight: bold;
    font-size: 18px;
}


/* Specific styles for toggle hidden fields */

.toggle-button {
    background-color: var(--color-secondary);
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.toggle-button:hover {
    background-color: var(--color-secondary-dark);
}


/* Hidden field wrapper styles */

.hidden-fields {
    border: 1px solid var(--color-border);
    padding: 16px;
    margin-top: 12px;
    border-radius: 4px;
    background-color: var(--color-hidden-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}


/* Table styles */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table,
th,
td {
    border: 1px solid var(--color-border);
}

th,
td {
    padding: 12px;
    text-align: left;
    transition: background-color 0.3s ease;
}

th {
    background-color: var(--color-table-header-bg);
}


/* Link styles */

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


/* Message styles */

.message {
    margin: 20px 0;
    padding: 12px;
    border-radius: 4px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.message.success {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}

.message.error {
    background-color: var(--color-error-bg);
    color: var(--color-error-text);
    border: 1px solid var(--color-error-border);
}


/* Item styles */

.items {
    margin-top: 20px;
}

.item {
    padding: 18px;
    background-color: var(--color-item-bg);
    border-radius: 4px;
    margin-bottom: 24px;
    transition: background-color 0.3s ease;
}

.item p {
    margin: 6px;
}

.card-title {
    margin: 0;
}

.group-title {
    text-align: center;
    font-weight: 500;
}

.title-wrapper {
    display: flex;
    align-items: center;
}

.title-wrapper a {
    padding-left: 18px;
    margin: 0;
    height: 25px;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.title-wrapper a img {
    height: 100%;
    transition: transform 0.3s;
}

p img {
    max-height: 200px;
}


/* Logout button styles */

.center-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
}

.logout-button {
    margin-bottom: 12px;
    width: auto;
    color: var(--color-warning-bg);
    transition: color 0.3s ease;
}


/* Edit button styles */

.edit-button {
    margin-top: 16px;
    background-color: var(--color-primary);
    transition: background-color 0.3s ease;
}

.edit-button:hover {
    background-color: var(--color-primary-dark);
}


/* Add item button styles */

.add-item-button img {
    width: 32px;
    height: 32px;
}


/* Loading overlay styles */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-overlay img {
    width: 64px;
    height: 64px;
}


/* Mobile styles */

@media (max-width: 768px) {
    body {
        padding: 0;
    }
    .container {
        padding: 16px;
        box-shadow: none;
        border-radius: 0;
    }
}