/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 0.8;
}

/* Main content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Welcome section */
.welcome-section {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.welcome-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.welcome-section p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Form container */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.form-container h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

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

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

/* Form elements */
.item-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
}

/* Form section */
.form-section {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.5rem;
    background-color: #fafafa;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.help-text {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Options */
#options-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.option-item {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.option-header h4 {
    color: #34495e;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-remove {
    background-color: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-remove:hover {
    background-color: #c0392b;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Footer */
footer {
    background-color: #34495e;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* Items list page */
.items-list-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: #2c3e50;
    margin: 0;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.item-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    background: white;
}

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

.item-thumbnail {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-content {
    padding: 1.25rem;
}

.item-content h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.item-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.item-type.video {
    background-color: #e3f2fd;
    color: #1976d2;
}

.item-type.audio {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.item-type.image {
    background-color: #e8f5e9;
    color: #388e3c;
}

.item-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
}

.pagination-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s, border-color 0.2s;
    min-width: 40px;
    text-align: center;
    display: inline-block;
}

.pagination-link:hover:not(.disabled):not(.active) {
    background-color: #f5f5f5;
    border-color: #999;
}

.pagination-link.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: 600;
}

.pagination-link.disabled {
    color: #999;
    cursor: not-allowed;
    background-color: #f9f9f9;
}

.pagination-ellipsis {
    padding: 0.5rem 0.25rem;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .form-container {
        padding: 1.5rem;
    }
    
    .welcome-section {
        padding: 2rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
