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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
}

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

/* Header and Navigation */
header {
    background-color: #1a1a1a;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4ade80;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: 4px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #4ade80;
}

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

/* Grid layout for items */
.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}

@media (max-width: 1200px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .items-grid {
        grid-template-columns: 1fr;
    }
}

.item-card {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.item-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background-color: #2a2a2a;
}

.item-image-wrapper {
    position: relative;
    display: block;
    text-decoration: none;
    overflow: hidden;
}

.item-image-wrapper:hover .item-download-overlay {
    opacity: 1;
}

.item-download-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.download-icon {
    font-size: 2.5rem;
    color: #4ade80;
    margin-bottom: 0.5rem;
}

.download-text {
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
}

.item-content {
    padding: 1rem;
}

.item-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #ffffff;
    line-height: 1.3;
}

.item-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
}

.item-title a:hover {
    color: #4ade80;
}

.item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0;
    font-size: 0.7rem;
    color: #999;
}

.item-info span {
    font-size: 0.7rem;
    white-space: nowrap;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-download {
    background-color: #4ade80;
    color: #000;
}

.btn-download::before,
.btn-secondary::before {
    margin-right: 6px;
}

.btn-download:hover {
    background-color: #22c55e;
}

.btn-secondary {
    background-color: #3b82f6;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #2563eb;
}

.btn-text {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.btn-text:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
}

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

/* Detail page */
.detail-page {
    max-width: 1000px;
    margin: 0 auto;
}

.detail-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.detail-hero-image {
    border-radius: 8px;
    overflow: hidden;
}

.detail-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.detail-hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-title {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    line-height: 1.3;
}

.detail-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.detail-meta-icon {
    font-size: 1.2rem;
}

.detail-meta-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-meta-value {
    font-size: 1rem;
    color: #e0e0e0;
    font-weight: bold;
}

.detail-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 6px;
}

.detail-section {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.detail-section-title {
    font-size: 1.3rem;
    color: #4ade80;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #333;
}

.detail-description {
    color: #ccc;
    line-height: 1.8;
    font-size: 1rem;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.detail-info-card {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s;
}

.detail-info-card:hover {
    transform: translateY(-3px);
}

.detail-info-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.detail-info-label {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.detail-info-value {
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: bold;
}

/* Related Shells */
.related-shells-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-shell-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

.related-shell-item:hover {
    background-color: #2a2a2a;
    border-color: #4ade80;
    transform: translateX(5px);
}

.related-shell-item .related-shell-title {
    font-size: 1rem;
    color: #fff;
    font-weight: 500;
    margin: 0;
}

.related-shell-item .related-shell-meta {
    font-size: 0.85rem;
    color: #999;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .detail-hero {
        grid-template-columns: 1fr;
    }

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

    .detail-title {
        font-size: 1.6rem;
    }

    .related-shell-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

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

.pagination-link {
    padding: 0.5rem 1rem;
    background-color: #1a1a1a;
    color: #e0e0e0;
    text-decoration: none;
    border: 1px solid #333;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination-link:hover {
    background-color: #333;
    color: #4ade80;
}

.pagination-link.active {
    background-color: #4ade80;
    color: #000;
    border-color: #4ade80;
}

/* Admin panel */
.admin-header {
    background-color: #1f2937;
    padding: 1rem 0;
    border-bottom: 2px solid #4ade80;
}

.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-links {
    display: flex;
    gap: 1rem;
}

.admin-links a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.admin-links a:hover {
    background-color: #374151;
}

.admin-content {
    padding: 2rem 0;
}

.admin-card {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: #1f2937;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #4ade80;
}

.stat-label {
    color: #999;
    margin-top: 0.5rem;
}

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

.form-block {
    background-color: #1f2937;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #374151;
}

.form-block-title {
    font-size: 1.1rem;
    color: #4ade80;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #374151;
}

.form-actions {
    display: flex;
    gap: 1rem;
    padding-top: 0.5rem;
}

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

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1rem;
}

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

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #4ade80;
}

/* Tables */
.admin-table {
    width: 100%;
    background-color: #1a1a1a;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
}

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

.admin-table th {
    background-color: #1f2937;
    font-weight: bold;
}

.admin-table tr:hover {
    background-color: #2a2a2a;
}

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

.table-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Login form */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
}

.login-form {
    background-color: #1a1a1a;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #333;
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #4ade80;
}

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

.message-success {
    background-color: #065f46;
    color: #4ade80;
    border: 1px solid #047857;
}

.message-error {
    background-color: #7f1d1d;
    color: #ef4444;
    border: 1px solid #dc2626;
}

/* Footer */
footer {
    background-color: #1a1a1a;
    border-top: 1px solid #333;
    padding: 2rem 0;
    text-align: center;
    color: #999;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .download-icon {
        font-size: 2rem;
    }

    .download-text {
        font-size: 0.9rem;
    }

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

    .admin-links {
        flex-direction: column;
        gap: 0.5rem;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
    }

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

    .pagination {
        flex-wrap: wrap;
    }
}
