/* 
 * Renaissance Man Press - Custom Styles
 * Built on top of Pico.css
 * Color scheme: Deep blue and gold accents (renaissance-inspired)
 */

:root {
    --primary: #1a365d;
    --primary-hover: #2c5282;
    --accent: #c9a227;
    --accent-light: #e6c84a;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
}

/* Typography */
body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.8;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: var(--primary);
}

/* Header & Navigation */
header {
    background: var(--primary);
    padding: 0.5rem 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

header nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

header nav a:hover,
header nav a.active {
    color: var(--accent);
}

header .logo {
    font-size: 1.25rem;
}

/* Logo styling */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    height: 36px;
    width: auto;
    border-radius: 4px;
}

main {
    padding-top: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, #2c5282 100%);
    color: white;
    border-radius: 0.5rem;
    margin-bottom: 3rem;
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta a[role="button"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
    font-weight: 600;
}

.hero-cta a[role="button"]:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
}

.hero-cta a.secondary {
    background: transparent;
    border-color: white;
    color: white;
}

.hero-cta a.secondary:hover {
    background: rgba(255,255,255,0.1);
}

/* Page Headers */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--accent);
}

.page-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-style: italic;
}

/* Sections */
section {
    margin-bottom: 3rem;
}

section h2 {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

/* Topic Cards */
#topics article,
.book-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

#topics article:hover,
.book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#topics article header,
.book-card header {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    padding: 0;
    background: none;
    border: none;
}

/* Book Status Badges */
.book-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.book-status {
    background: var(--accent);
    color: var(--primary);
}

.book-status.available {
    background: #22c55e;
    color: white;
}

.book-status.coming-soon {
    background: var(--primary);
    color: white;
}

.book-card.coming-soon-card {
    cursor: pointer;
}

.book-cover-wrap {
    position: relative;
    overflow: hidden;
}

.coming-soon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 54, 93, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.book-card.coming-soon-card:hover .coming-soon-overlay {
    opacity: 1;
}

.coming-soon-overlay span {
    background: var(--accent);
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
}

.notify-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.notify-modal-backdrop.active {
    display: flex;
}

.notify-modal {
    background: white;
    border-radius: 0.75rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.notify-modal h2 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.notify-modal .modal-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.notify-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.notify-modal-close:hover {
    color: var(--primary);
}

.btn-waitlist {
    display: inline-block;
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    margin-top: 0.25rem;
}

.btn-waitlist:hover {
    background: #b8911f;
    color: white;
    transform: translateY(-1px);
}

.btn-kindle {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    margin-top: 0.25rem;
}

.btn-kindle:hover {
    background: #0f2440;
    color: white;
    transform: translateY(-1px);
}

/* Books Grid with Covers */
.books-grid,
.featured-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.book-card.with-cover {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.book-card.with-cover:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.book-cover {
    width: 100%;
    height: 350px;
    object-fit: cover;
    object-position: top;
}

.book-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-info h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    color: var(--primary);
}

.book-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
    flex-grow: 1;
}

.book-author {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
    margin: 0;
}

.submission-card {
    text-decoration: none;
    cursor: pointer;
}


.submission-card:hover .book-link {
    color: var(--accent);
}

.book-link {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
    margin: 0;
    transition: color 0.2s;
}

/* Flash Messages */
.flash-message {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

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

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

/* Forms */
form label {
    font-weight: 600;
    color: var(--primary);
}

form button[type="submit"] {
    background: var(--primary);
    border-color: var(--primary);
}

form button[type="submit"]:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.form-placeholder {
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
    padding: 2rem;
    text-align: center;
    border-radius: 0.5rem;
    color: var(--text-muted);
}

/* Blockquotes */
blockquote {
    background: #fff9e6;
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}

/* Details/FAQ */
details {
    margin-bottom: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
}

details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-bottom: 2rem;
}

footer hr {
    border-color: var(--border-color);
    margin-bottom: 2rem;
}

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

.footer-info p {
    margin: 0.25rem 0;
    color: var(--text-muted);
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin: 0.5rem 0;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-social {
    color: var(--text-muted);
}

.footer-social p {
    margin-bottom: 0.6rem;
}

.footer-social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Shared Social Icon Button */
.social-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.social-icon-btn:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

/* Subdued variant — used in the hero (white/translucent on dark background) */
.social-icon-btn--subdued {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.social-icon-btn--subdued:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    opacity: 1;
}

/* Hero Social Bar */
.hero-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.hero-social-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-social-icons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Utility Classes */
.center {
    text-align: center;
}

.coming-soon-notice {
    background: var(--bg-light);
    padding: 2rem;
    text-align: center;
    border-radius: 0.5rem;
    color: var(--text-muted);
}

.alt-contact {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cta-section {
    text-align: center;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
}

.cta-section a[role="button"] {
    margin: 0.5rem;
}

/* Social Media Accordion */
.social-accordion {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.social-item {
    border-bottom: 1px solid var(--border-color);
}

.social-item:last-child {
    border-bottom: none;
}

.social-item-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    transition: background 0.15s;
}

.social-item-header:hover {
    background: #eef2f7;
}

.social-item.open .social-item-header {
    background: #eef2f7;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
}

.social-item-name {
    flex: 1;
}

.social-item-points {
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--accent);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    white-space: nowrap;
}

.social-item-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.25s;
    display: inline-block;
}

.social-item.open .social-item-chevron {
    transform: rotate(180deg);
}

.social-item-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1rem;
    background: white;
}

.social-item.open .social-item-body {
    padding: 1rem;
}

.btn-social-action {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.55rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    margin-bottom: 1rem;
}

.btn-social-action:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-social-action.patreon-action {
    background: #FF424D;
}

.btn-social-action.patreon-action:hover {
    background: #e03038;
}

.social-action-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.patreon-header {
    background: #fff5f5;
}

.patreon-header:hover {
    background: #ffe8e8;
}

.social-item.open .patreon-header {
    background: #ffe8e8;
}

/* Contest Page */
.points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.points-card {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.points-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.points-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Georgia', serif;
}

.points-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.contest-note {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.contest-form-section {
    max-width: 700px;
    margin: 0 auto 3rem;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-section-title {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    border-left: none;
    padding-left: 0;
}

.form-section-title small {
    font-weight: 400;
    color: var(--text-muted);
}

.social-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-help {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.referral-display {
    max-width: 600px;
    margin: 0 auto 3rem;
    text-align: center;
}

.referral-link-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--bg-light);
    border: 2px solid var(--accent);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.referral-link-box code {
    font-size: 0.9rem;
    word-break: break-all;
    color: var(--primary);
}

.btn-copy {
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.85rem;
}

.btn-copy:hover {
    background: var(--accent-light);
}

.past-winners {
    margin-top: 3rem;
}

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

.winner-card {
    background: linear-gradient(135deg, var(--primary) 0%, #2c5282 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.winner-card::before {
    content: '\2605';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 3rem;
    opacity: 0.15;
    color: var(--accent);
}

.winner-month {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.winner-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.winner-prize {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.85;
}

/* Admin Styles */
.admin-login-section {
    max-width: 400px;
    margin: 2rem auto;
}

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

.admin-header h1 {
    margin: 0;
}

.admin-actions-bar {
    display: flex;
    gap: 0.75rem;
}

.btn-admin {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-admin:hover {
    background: var(--primary-hover);
    color: white;
}

.btn-admin.secondary {
    background: var(--text-muted);
}

.btn-admin.secondary:hover {
    background: #475569;
}

.admin-sort {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.admin-sort a {
    color: var(--text-muted);
    text-decoration: none;
}

.admin-sort a.active {
    color: var(--primary);
    font-weight: 700;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    background: var(--primary);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

.admin-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-table tbody tr:hover {
    background: var(--bg-light);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.verified {
    background: #22c55e;
    color: white;
}

.badge.unverified {
    background: var(--accent);
    color: var(--primary);
}

.pick-winner-form {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.admin-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.entry-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.entry-info-card,
.entry-socials-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.entry-info-card h2 {
    margin-top: 0;
    border-left: none;
    padding-left: 0;
}

.entry-socials-card h3 {
    margin-top: 0;
}

.social-list {
    list-style: none;
    padding: 0;
}

.social-list li {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-color);
}

.social-list li:last-child {
    border-bottom: none;
}

.entry-proof {
    margin-bottom: 2rem;
}

.proof-image {
    max-width: 100%;
    max-height: 500px;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.entry-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.action-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.action-card h3 {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
    header nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    header nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .footer-content {
        text-align: center;
    }

    .form-group-row,
    .social-fields-grid {
        grid-template-columns: 1fr;
    }

    .pick-winner-form {
        grid-template-columns: 1fr;
    }

    .entry-detail-grid,
    .entry-actions-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
