/* Global Styles */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #4fc3f7;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --border-radius: 4px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    color: var(--secondary-color);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-edit {
    background-color: var(--info-color);
}

.btn-edit:hover {
    background-color: #138496;
}

.btn-delete {
    background-color: var(--danger-color);
}

.btn-delete:hover {
    background-color: #c82333;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Header Styles */
.header {
    background-color: white;
    box-shadow: var(--box-shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    font-weight: 500;
}

.mobile-menu {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* Footer Styles */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
}

/* Auth Forms */
.auth-form {
    max-width: 500px;
    margin: 30px auto;
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
}

.form-group textarea {
    min-height: 100px;
}

.checkbox {
    display: flex;
    align-items: center;
}

.checkbox input {
    width: auto;
    margin-right: 10px;
}

.auth-link {
    margin-top: 20px;
    text-align: center;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.image-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s;
}

.image-card:hover {
    transform: translateY(-5px);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-info {
    padding: 15px;
}

.image-info h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.image-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.stats i {
    margin-right: 5px;
}

/* Image View Page */
.image-view {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 30px 0;
}

.image-container {
    margin-bottom: 30px;
}

.image-container img {
    max-width: 100%;
    max-height: 600px;
    display: block;
    margin: 0 auto;
    border-radius: var(--border-radius);
}

.image-details h1 {
    margin-bottom: 10px;
}

.author {
    color: #666;
    margin-bottom: 20px;
}

.description {
    margin-bottom: 20px;
    white-space: pre-line;
}

.like-btn {
    color: #666;
    transition: color 0.3s;
}

.like-btn.liked {
    color: var(--danger-color);
}

.like-btn:hover {
    color: var(--danger-color);
}

/* Comments Section */
.comments-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    min-height: 100px;
}

.comments-list {
    margin-top: 20px;
}

.comment {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

/* Profile Page */
.profile-info {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.profile-details h2 {
    margin-bottom: 5px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0;
}

.pagination a {
    padding: 8px 15px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.pagination a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Upload Form */
.upload-form {
    max-width: 600px;
    margin: 30px auto;
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Admin Styles */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
}

.stat-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #666;
}

.stat-card p {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.admin-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.admin-link {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform 0.3s;
}

.admin-link:hover {
    transform: translateY(-5px);
}

.admin-link i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: block;
}

.admin-link span {
    font-size: 18px;
    font-weight: 500;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background-color: white;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.admin-table tr:hover {
    background-color: #f5f5f5;
}

.thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.actions {
    white-space: nowrap;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .admin-table {
        display: block;
        overflow-x: auto;
    }
}