/* ==================================================
   Photocard Page Styles
================================================== */
body.photocard-page {
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    font-family: 'Kalpurush', sans-serif;
}

.photocard-container {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.photocard-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.photocard-header h1 {
    margin: 0 0 20px 0;
    font-size: 26px;
    color: #333;
}

.photocard-templates-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pc-tab-btn {
    padding: 10px 20px;
    background: #f1f1f1;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    transition: 0.3s;
    font-family: inherit;
    color: #555;
    white-space: nowrap;
    flex: 1 1 calc(50% - 10px);
    max-width: 180px;
}

.pc-tab-btn.active, .pc-tab-btn:hover {
    background: #1877f2; /* A nice default blue, or var(--primary-color) if available */
    color: #fff;
}

@media (max-width: 480px) {
    .pc-tab-btn {
        padding: 8px 15px;
        font-size: 14px;
        flex: 1 1 40%;
    }
}

.photocard-body {
    padding: 40px 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
}

.photocard-footer {
    padding: 25px;
    border-top: 1px solid #eee;
    text-align: center;
    background: #fff;
}

.pc-download-btn {
    background: #198754;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.pc-download-btn:hover {
    background: #157347;
}

.pc-template-wrapper {
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.pc-template-wrapper.active {
    display: block;
}

/* -------------------------------------
   Template Base
-------------------------------------- */
.pc-card {
    width: 640px;
    background: #fff;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.pc-card * {
    box-sizing: border-box;
}

/* Template 1 - White/Cyan */
.pc-style-1 {
    display: flex;
    flex-direction: column;
}

.pc-header-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #fff;
}

.pc-logo-1 img {
    height: 50px;
    object-fit: contain;
}

.pc-date-1 {
    background: #e6f6f3;
    color: #032b21;
    font-weight: bold;
    padding: 10px 20px;
    border-left: 4px solid #168a71;
    font-size: 18px;
}

.pc-image-1 {
    width: 100%;
    height: 280px;
}

.pc-image-1 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pc-content-1 {
    background: #f2faf8;
    padding: 50px 40px 70px 40px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.pc-title-1 {
    font-size: var(--live-title-size, 34px);
    line-height: 1.5;
    color: #111;
    margin: 0;
    font-weight: 700;
}

.pc-footer-1 {
    background: linear-gradient(180deg, #8ad1c4 0%, #64c2b1 100%);
    text-align: center;
    padding: 20px;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
}

/* Template 2 - Asia Post Style */
.pc-style-2 {
    display: flex;
    flex-direction: column;
    background: #1a1a3e;
}

/* Image Section (Top Half) */
.pc-image-section-2 {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.pc-featured-img-2 {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Logo Watermark - Top Right */
.pc-logo-2 {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.pc-logo-2 img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Site Name Banner - Bottom Center of Image */
.pc-site-banner-2 {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    background: #ffffff;
    padding: 8px 25px;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.pc-banner-logo-2 {
    height: 35px;
    object-fit: contain;
    display: block;
}

.pc-banner-name-2 {
    color: #333;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Headline Section (Bottom Half) */
.pc-headline-section-2 {
    background: linear-gradient(180deg, #1a1a5e 0%, #2a1a60 40%, #1a1040 100%);
    padding: 40px 35px 30px 35px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.pc-style-2 .pc-title-2 {
    color: #ffffff;
    font-size: var(--live-title-size, 36px);
    line-height: 1.5;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Footer Bar */
.pc-footer-bar-2 {
    background: linear-gradient(90deg, #8b0000 0%, #cc0000 50%, #8b0000 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.pc-footer-domain-2 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pc-footer-domain-2 i {
    font-size: 14px;
}

.pc-footer-center-2 {
    font-weight: 700;
    font-size: 16px;
    color: #ffde00;
}

.pc-footer-date-2 {
    font-weight: 600;
}

/* ==========================================
   Template 3 - Kalbela Style
========================================== */
.pc-style-3 {
    display: flex;
    flex-direction: column;
    background-color: #e8e8e8;
    background-image: radial-gradient(circle, #ccc 1px, transparent 1px);
    background-size: 12px 12px;
    position: relative;
}

/* Watermark - Top Right */
.pc-watermark-3 {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 3;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
}

.pc-watermark-3 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Featured Image */
.pc-image-section-3 {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.pc-featured-img-3 {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* Date Badge - Left Side */
.pc-date-badge-3 {
    position: relative;
    margin-top: -5px;
    z-index: 2;
    align-self: flex-start;
    margin-left: 15px;
}

.pc-date-badge-3 span {
    background: #c00;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 18px;
    display: inline-block;
    border-radius: 0 0 4px 4px;
}

/* Red Divider */
.pc-divider-3 {
    width: calc(100% - 60px);
    height: 3px;
    background: #c00;
    margin: 10px auto 0 auto;
}

/* Headline Section */
.pc-headline-section-3 {
    padding: 20px 35px 15px 35px;
    text-align: center;
}

.pc-title-3 {
    color: #8b0000;
    font-size: var(--live-title-size, 36px);
    line-height: 1.5;
    font-weight: 800;
    margin: 0 0 10px 0;
}

.pc-subtitle-3 {
    color: #8b0000;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

/* Bottom Domain Bar */
.pc-bottom-bar-3 {
    padding: 10px 30px 20px 30px;
    text-align: center;
}

.pc-bottom-line-3 {
    width: 100%;
    height: 2px;
    background: #c00;
    margin-bottom: 10px;
}

.pc-domain-3 {
    color: #333;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ==========================================
   Template 4 
========================================== */
.pc-style-4 {
    display: flex;
    flex-direction: column;
    background: #000;
}

.pc-image-section-4 {
    position: relative;
    width: 100%;
    height: 430px;
    overflow: hidden;
}

.pc-featured-img-4 {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pc-overlay-4 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 40%, rgba(0,0,0,0.01) 100%);
}

.pc-headline-box-4 {
    position: absolute;
    bottom: 5px;
    left: 5%;
    width: 90%;
    z-index: 10;
    border: 2px solid #fff;
    padding: 15px 20px;
    text-align: center;
}

.pc-post-subtitle-4 {
    color: #ffde00;
    font-size: var(--live-subtitle-size, 22px);
    margin: 0 0 var(--live-title-gap, 5px) 0;
    font-weight: 700;
}

.pc-title-4 {
    color: #fff;
    font-size: var(--live-title-size, 30px);
    line-height: 1.4;
    font-weight: 800;
    margin: 0;
}

.pc-text-yellow-4 {
    color: #ffde00;
}

.pc-bottom-section-4 {
    position: relative;
    background: #000;
    padding: 5px 30px 20px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    min-height: 110px;
}

/* Pattern overlay removed as per user request */

.pc-logo-4 {
    z-index: 2;
    margin-top: auto;
    margin-bottom: 0;
}

.pc-logo-4 img {
    height: 45px;
    object-fit: contain;
}

.pc-logo-4 h2 {
    color: #fff;
    margin: 0;
}

.pc-footer-4 {
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0;
}

.pc-date-4, .pc-domain-4 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

/* Scale down preview for smaller screens */
@media (max-width: 768px) {
    .photocard-preview-container {
        transform: scale(0.5);
        transform-origin: top center;
        height: 450px;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .photocard-preview-container {
        transform: scale(0.8);
        transform-origin: top center;
        height: 650px;
    }
}

/* Live Controls and Global Subtitle Styles */
.pc-post-subtitle {
    color: #e33226;
    font-weight: 600;
    font-size: var(--live-subtitle-size, 17.6px);
    margin-bottom: var(--live-title-gap, 5px);
    margin-top: 0;
}

.photocard-controls {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 640px;
}
.photocard-controls h3 {
    margin-top: 0;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: #333;
}
.control-group {
    margin-bottom: 15px;
}
.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #444;
}
.control-group label span {
    color: #1877f2;
    float: right;
}
.control-group input[type="range"] {
    width: 100%;
}
.pc-reset-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background 0.3s;
}
.pc-reset-btn:hover {
    background: #5a6268;
}

@media (max-width: 768px) {
    body { padding: 0 !important; }
    .photocard-container {
        margin: 0 auto;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }
    .photocard-body {
        padding-left: 10px;
        padding-right: 10px;
    }
    .photocard-header {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Custom Mode Styles */
body.pc-custom-mode-active .pc-template-wrapper img {
    cursor: pointer;
    transition: opacity 0.3s;
}
body.pc-custom-mode-active .pc-template-wrapper img:hover {
    opacity: 0.7;
    outline: 2px dashed #1877f2;
}
body.pc-custom-mode-active [contenteditable="true"] {
    outline: 1px dashed #aaa;
    background: rgba(255,255,255,0.1);
}
body.pc-custom-mode-active [contenteditable="true"]:hover {
    outline: 1px dashed #1877f2;
}
body.pc-custom-mode-active [contenteditable="true"]:focus {
    outline: 2px solid #1877f2;
    background: rgba(255,255,255,0.2);
}

