/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background: #f5f7fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* TOP BLUE CONTAINER */
.top-container {
    background: linear-gradient(135deg, #1a6dff, #0d4fc9);
    color: white;
    padding: 20px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 150, 0.2);
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    max-width: 100vw;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.logo {
    height: 40px;
    width: auto;
}

.top-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.9;
    max-width: 100%;
    margin-bottom: 10px;
}

/* HAMBURGER MENU */
.hamburger-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-line {
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu:hover .hamburger-line {
    background-color: rgba(255, 255, 255, 0.8);
}

/* SIDE MENU */
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.side-menu.active {
    transform: translateX(0);
}

.menu-header {
    background: #1a6dff;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-items {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.menu-items a {
    color: #333;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    font-weight: 500;
}

.menu-items a:hover {
    background: #f0f4ff;
    color: #1a6dff;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* MAIN CONTAINER */
.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
    flex: 1;
}

.controls-panel, .preview-panel {
    width: 100%;
    max-width: 100%;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    overflow: hidden;
}

/* PROFILE UPLOAD SECTION */
.profile-upload-section {
    margin-bottom: 20px;
}

.profile-upload-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.profile-preview {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 50%;
    background: #f0f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #1a6dff;
    overflow: hidden;
}

/* PROFILE IMAGE FIXES - No stretching */
.profile-preview img, #previewProfilePic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.default-avatar {
    font-size: 2rem;
    color: #1a6dff;
}

.upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 150px;
}

.btn-upload, .btn-remove {
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-upload {
    background: #1a6dff;
    color: white;
}

.btn-upload:hover {
    background: #0d4fc9;
}

.btn-remove {
    background: #ff4757;
    color: white;
}

.btn-remove:hover {
    background: #ff3742;
}

.font-size-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
}

.font-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #1a6dff;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.font-btn:hover {
    background: #1558cc;
}

#fontSizeDisplay {
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

/* CONTROL GROUPS */
.control-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    width: 100%;
}

.control-group:last-child {
    border-bottom: none;
}

.control-group h3 {
    color: #1a6dff;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
}

input[type="text"],
textarea,
select {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    margin-top: 6px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border 0.3s;
    box-sizing: border-box;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    border-color: #1a6dff;
    outline: none;
}

textarea {
    min-height: 100px;
    resize: vertical;
    width: 100%;
    white-space: pre-wrap;
}

/* TOGGLE BUTTONS */
.toggle {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.theme-btn,
.align-btn {
    flex: 1;
    min-width: 60px;
    padding: 10px;
    border: 2px solid #ccc;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.theme-btn.active,
.align-btn.active {
    background: #1a6dff;
    color: white;
    border-color: #1a6dff;
}

/* ACTION BUTTONS */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
    width: 100%;
}

.btn-primary,
.btn-secondary {
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(to right, #1a6dff, #0d4fc9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(26, 109, 255, 0.4);
}

.btn-secondary {
    background: #f0f4ff;
    color: #1a6dff;
    border: 2px solid #1a6dff;
}

.btn-secondary:hover {
    background: #e1e9ff;
}

/* PREVIEW */
.preview-container {
    background: #f0f2f5;
    border-radius: 16px;
    padding-top: 80px;
    padding-bottom: 100px;
    padding-left: 20px;
    padding-right: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 2px solid #ddd;
}

.facebook-post {
    width: 100%;
    max-width: 100%;
    background: white;
    border-radius: 12px;
    padding-top: 80px;
    padding-bottom: 100px;
    padding-left: 25px;
    padding-right: 25px;
    color: #333;
    box-sizing: border-box;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

#previewProfilePic {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    background: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.post-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
}

.post-meta strong {
    font-size: 1rem;
}

.post-meta span {
    font-size: 0.85rem;
    opacity: 0.7;
}

.post-body {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.post-body #previewText {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 0;
}

/* POSTIFY WATERMARK IN PREVIEW */
.facebook-post::after {
    content: 'PostaPlux';
    position: absolute;
    top: 25px;
    right: 20px;
    font-style: italic;
    opacity: 0.3;
    font-size: 0.9rem;
    color: inherit;
    pointer-events: none;
}

/* DOWNLOAD AREA */
.download-area {
    margin-top: 25px;
    text-align: center;
    width: 100%;
}

.output-placeholder {
    background: #f8f9fa;
    border: 2px dashed #aaa;
    border-radius: 12px;
    padding: 30px 15px;
    margin: 15px 0;
    color: #666;
    font-style: italic;
    width: 100%;
    box-sizing: border-box;
}

.btn-download {
    background: #00c853;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    width: 100%;
    max-width: 300px;
}

.btn-download:hover {
    background: #00b247;
    transform: scale(1.05);
}

.btn-download:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* FOOTER - SAME BLUE AS HEADER */
footer {
    background: linear-gradient(135deg, #1a6dff, #0d4fc9);
    color: white;
    margin-top: 50px;
    padding: 40px 20px 20px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 150, 0.2);
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.footer-section {
    text-align: center;
    padding: 0 5px;
}

.footer-section h4 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-link {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.footer-link:hover {
    color: white;
    text-decoration: underline;
}

.footer-text {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    font-size: 0.7rem;
    margin-top: 3px;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-bottom strong {
    color: white;
}

/* CONTENT PAGES STYLES - ADDED FOR MENU PAGES */
.content-page {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin: 20px auto;
}

.content-page h2 {
    color: #1a6dff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-page h3 {
    color: #333;
    margin: 25px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f4ff;
}

/* BLOG STYLES */
.blog-posts {
    display: grid;
    gap: 20px;
    margin-top: 30px;
}

.blog-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #1a6dff;
    transition: transform 0.3s;
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-date {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.blog-tags {
    margin-top: 15px;
}

.tag {
    display: inline-block;
    background: #e1e9ff;
    color: #1a6dff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 8px;
}

/* ABOUT PAGE */
.about-section {
    line-height: 1.6;
}

.about-section p {
    margin-bottom: 15px;
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.stat {
    text-align: center;
    padding: 20px;
    background: #f0f4ff;
    border-radius: 12px;
}

.stat h4 {
    font-size: 2rem;
    color: #1a6dff;
    margin-bottom: 10px;
}

/* CONTACT PAGE */
.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.contact-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.contact-card h3 {
    margin: 15px 0 10px;
}

.contact-form {
    margin-top: 40px;
}

/* FAQ */
.faq-preview {
    margin-top: 40px;
}

.faq-item {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.faq-item h4 {
    color: #1a6dff;
    margin-bottom: 10px;
}

/* PRIVACY POLICY */
.privacy-content {
    line-height: 1.6;
}

.policy-section {
    margin: 25px 0;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.policy-section:last-child {
    border-bottom: none;
}

.policy-section ul {
    margin: 15px 0 15px 20px;
}

.policy-section li {
    margin: 8px 0;
    line-height: 1.5;
}

/* PLACEHOLDER CARDS */
.placeholder-content {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.placeholder-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    border: 2px dashed #ddd;
}

.placeholder-card h3 {
    margin: 15px 0 10px;
}

/* FAQ PAGE SPECIFIC STYLES */
.faq-section {
    margin: 40px 0;
}

.faq-section h3 {
    color: #1a6dff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e9ff;
}

.faq-item {
    margin: 15px 0;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: #1a6dff;
    box-shadow: 0 2px 8px rgba(26, 109, 255, 0.1);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.3s;
}

.faq-question:hover {
    background: #f0f4ff;
}

.faq-question h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    flex: 1;
}

.faq-toggle {
    background: #1a6dff;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.faq-toggle:hover {
    background: #0d4fc9;
    transform: scale(1.1);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
}

.faq-answer p {
    padding: 20px;
    margin: 0;
    line-height: 1.6;
    border-top: 1px solid #e9ecef;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

/* TERMS PAGE SPECIFIC STYLES */
.terms-content {
    line-height: 1.6;
}

.terms-section {
    margin: 25px 0;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.terms-section:last-child {
    border-bottom: none;
}

.terms-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.terms-section p {
    margin-bottom: 15px;
}

.terms-section ul {
    margin: 15px 0 15px 20px;
}

.terms-section li {
    margin: 8px 0;
    line-height: 1.5;
}

.terms-section a {
    color: #1a6dff;
    text-decoration: none;
}

.terms-section a:hover {
    text-decoration: underline;
}

/* BUTTON FOR PAGES */
.btn-primary {
    background: linear-gradient(to right, #1a6dff, #0d4fc9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 109, 255, 0.3);
}

/* RESPONSIVE */
@media (min-width: 768px) {
    .container {
        flex-direction: row;
        max-width: 1200px;
        padding: 0 20px;
    }
    
    .controls-panel, .preview-panel {
        flex: 1;
    }
    
    .top-container {
        padding: 20px 30px;
    }
    
    .top-container h1 {
        font-size: 1.8rem;
    }
    
    .logo {
        height: 50px;
    }
    
    .profile-preview {
        width: 80px;
        height: 80px;
    }
    
    #previewProfilePic {
        width: 50px;
        height: 50px;
    }
    
    .footer-content {
        gap: 25px;
    }
    
    .footer-link {
        font-size: 0.85rem;
    }
    
    .footer-text {
        font-size: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1300px;
    }
    
    .controls-panel, .preview-panel {
        padding: 25px;
    }
}

/* Ensure no horizontal scroll on mobile */
@media (max-width: 767px) {
    body {
        padding-bottom: 20px;
    }
    
    .top-container h1 {
        font-size: 1.3rem;
        max-width: calc(100% - 50px);
    }
    
    .logo-title {
        flex-direction: row;
    }
    
    .menu-items a {
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    
    .btn-upload, .btn-remove {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
    
    input[type="text"],
    textarea,
    select {
        font-size: 16px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .content-page {
        padding: 20px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .contact-methods {
        grid-template-columns: 1fr;
    }
    
    .blog-posts {
        grid-template-columns: 1fr;
    }
    
    .placeholder-content {
        grid-template-columns: 1fr;
    }
    
    .faq-question {
        padding: 15px;
    }
    
    .faq-question h4 {
        font-size: 1rem;
    }
    
    .faq-answer p {
        padding: 15px;
    }
    
    .terms-section {
        padding-bottom: 20px;
    }
}

/* Prevent textarea resize from causing overflow */
textarea {
    max-width: 100%;
}