/*
Theme Name: Image Prompts Theme
Description: A modern WordPress theme for image prompts with rating and sharing features.
Version: 5.8
Author: Bahaa
*/

:root {
    --primary-color: #28A0FF;
    --secondary-color: #6C5CE7;
    --background-dark: #0A0A19;
    --card-background: #1A1A2E;
    --text-primary: #FFFFFF;
    --text-secondary: #B4B4C8;
    --success-color: #00D9A3;
    --error-color: #FF5C5C;
    --border-radius: 12px;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-dark);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--card-background);
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.site-title {
    font-size: 2em;
    text-align: center;
    color: var(--primary-color);
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.site-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-description {
    margin: 5px 0 0 0;
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 300;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-navigation {
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.nav-menu li a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    background-color: var(--background-dark);
    transition: background-color 0.3s, color 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-menu li a:hover {
    background-color: var(--primary-color);
    color: var(--background-dark);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Mobile navigation */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-menu li a {
        padding: 6px 10px;
        font-size: 0.9em;
    }
}

/* Main content */
.main-content {
    padding: 20px 5px;
}

/* Grid for homepage */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.post-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.post-thumbnail {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

/* Responsive thumbnail heights */
@media (max-width: 768px) {
    .post-thumbnail {
        height: 250px; /* Slightly smaller on tablets */
    }
}

@media (max-width: 480px) {
    .post-thumbnail {
        height: 150px; /* More compact on mobile phones */
    }
}

.post-content {
    padding: 15px;
}

.post-title {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.rating {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.rating-likes {
    font-weight: bold;
    color: var(--error-color); /* Red color for the heart and text */
}

.rating-likes i {
    color: var(--error-color); /* Red heart icon */
    margin-right: 5px;
}

.post-data {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-label {
    display: inline-block;
    background: var(--primary-color);
    color: var(--background-dark);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.6em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.category-label:hover {
    opacity: 0.8;
}

.tag-label {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--background-dark);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.tag-label:hover {
    opacity: 0.8;
}

.post-categories-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.post-categories,
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.post-categories {
    margin-bottom: 10px;
}

.post-tags {
    margin-top: 20px;
}

.page-content {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    margin-bottom: 30px;
}

.page-content h1 {
    color: var(--text-primary);
    font-size: 2.5em;
    margin-bottom: 20px;
    text-align: center;
}

.page-featured-image {
    text-align: center;
    margin-bottom: 30px;
}

.page-featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.page-body {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.1em;
}

.page-body h2,
.page-body h3,
.page-body h4,
.page-body h5,
.page-body h6 {
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.page-body p {
    margin-bottom: 20px;
}

.page-body ul,
.page-body ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.page-body li {
    margin-bottom: 8px;
}

/* Categories Archive Page */
.categories-header {
    text-align: center;
    margin-bottom: 40px;
}

.categories-header h1 {
    color: var(--text-primary);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.categories-header p {
    color: var(--text-secondary);
    font-size: 1.2em;
    max-width: 600px;
    margin: 0 auto;
}

.page-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.no-content {
    text-align: center;
    padding: 50px 20px;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.no-content h2 {
    color: var(--text-primary);
    font-size: 2em;
    margin-bottom: 15px;
}

.no-content p {
    color: var(--text-secondary);
    font-size: 1.1em;
}

/* Mobile responsive for pages */
@media (max-width: 768px) {
    .page-content {
        padding: 20px;
        margin: 0 10px;
    }
    
    .page-content h1 {
        font-size: 2em;
    }
    
    .page-body {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 15px;
        margin: 0 5px;
    }
    
    .page-content h1 {
        font-size: 1.8em;
    }
}

.related-posts-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--secondary-color);
}

.related-posts-section h3 {
    font-size: 1.5em;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

/* Hide excerpt text in grid post cards */
.post-card p {
    display: none;
}

/* Hide post-meta on single posts */
.single-post .post-meta {
    display: none;
}

/* Single post */
.single-post .featured-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 70vh; /* Maximum 70% of viewport height */
    object-fit: contain; /* Show full image without cropping */
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile responsive image */
@media (max-width: 768px) {
    .single-post .featured-image {
        max-height: 50vh; /* Smaller on mobile to save space */
        width: 100%;
        max-width: 100vw;
    }
    
    .container {
        padding: 0 15px; /* Reduce padding on tablets */
    }
}

@media (max-width: 480px) {
    .single-post .featured-image {
        max-height: 40vh; /* Even smaller on very small screens */
    }
    
    .container {
        padding: 0 12px; /* More comfortable padding on mobile phones */
    }

    .main-content {
        padding: 15px 5px;
    }
    
    .post-actions {
        /* Keep side-by-side layout on mobile */
        flex-direction: row;
        gap: 15px;
        align-items: center;
        justify-content: space-between;
        margin: 20px 0;
    }
    
    .post-actions .rating-buttons,
    .post-actions .share-buttons {
        /* Keep natural width for side-by-side layout */
        width: auto;
        justify-content: flex-start;
    }
}

.prompt-box {
    background: var(--card-background);
    border: 1px solid var(--secondary-color);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.prompt-text {
    font-family: monospace;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

.copy-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background: #6C5CE7;
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #5a6268; /* Grey on hover */
}

.rating-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.like-btn, .dislike-btn {
    padding: 10px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1em;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
}

.like-btn:hover {
    background: #5a6268; /* Darker grey on hover */
    transform: translateY(-2px);
}

.dislike-btn:hover {
    transform: translateY(-2px);
}

.vote-count {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-primary);
}

.like-btn {
    background: #6c757d; /* Grey background by default */
    color: var(--text-primary);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.dislike-btn {
    background: var(--error-color);
    color: var(--text-primary);
}

.share-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.share-btn {
    padding: 10px 12px;
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.share-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.share-facebook { background: #1877f2; }
.share-twitter { background: #333535; }
.share-pinterest { background: #bd081c; }
.share-whatsapp { background: #25d366; }

/* Footer */
.site-footer {
    background: var(--card-background);
    color: var(--text-secondary);
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr); /* Two columns on mobile/tablet */
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card-background);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left-color: var(--success-color);
}

.toast-error {
    border-left-color: var(--error-color);
}

/* Enhanced button feedback */
.copy-btn.copied {
    background: var(--success-color) !important;
    color: var(--background-dark) !important;
}

.like-btn:disabled, .dislike-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.like-btn.voted {
    background: var(--error-color) !important; /* Red when liked */
    color: var(--text-primary) !important;
    border-color: #cc0000; /* Darker red border */
    transform: scale(1.05);
}

.like-btn.voted:hover {
    background: #cc0000 !important; /* Darker red on hover when liked */
}

.dislike-btn.voted {
    background: var(--error-color) !important;
    color: var(--text-primary) !important;
    transform: scale(1.05);
}

/* Post actions layout - voting and sharing side by side */
.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    gap: 15px; /* Reduced gap for better balance */
}

.post-actions .rating-buttons {
    display: flex;
    gap: 10px;
    justify-content: center; /* Center buttons within the rating column */
}

.post-actions .share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center; /* Center buttons within the sharing column */
}