/* =========================================================
   FRAMEGEN STYLE SHEET (Duclos Standard)
   Clean UI + White Print Preview
========================================================= */


/* ===== GLOBAL ===== */
body {
    background: radial-gradient(circle, rgba(55,69,103,1) 40%, rgba(27,27,28,1) 100%);
    background-attachment: fixed;
    margin: 0;
    padding: 0;
    font-family: 'Barlow', Arial, sans-serif;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Links */
a {
    color: #0497E7;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


/* ===== HEADER ===== */
.header-container {
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.header-content-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.title-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    height: 28px;
}

.site-title {
    font-size: 1.4em;
    font-weight: 600;
    margin: 0;
}


/* ===== PAGE TITLE ===== */
.page-title {
    max-width: 1000px;
    margin: 20px auto 10px auto;
    text-align: center;
}

.page-title h2 {
    margin: 0 0 10px 0;
}

.page-title p {
    color: #ccc;
    font-size: 0.95em;
}


/* ===== MAIN LAYOUT ===== */
.main-content-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.framegen-shell {
    display: flex;
    gap: 20px;
}

/* Responsive */
@media (max-width: 900px) {
    .framegen-shell {
        flex-direction: column;
    }
}


/* ===== PANELS ===== */
.framegen-panel {
    flex: 1;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.framegen-panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.framegen-panel-header h3 {
    margin: 0;
}

.framegen-panel-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* ðŸ‘ˆ keeps preview centered */
}


/* ===== FORM ===== */
.form-field {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center; /* ✅ THIS is the fix */
}

.form-field label {
    text-align: right;
    margin: 0; /* prevents vertical offset */
    color: #ccc;
}

/* Inputs */
.styled-input,
.styled-dropdown {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 1em;
    box-sizing: border-box;
}

/* Dropdown arrow */
.styled-dropdown {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23fff" height="16" viewBox="0 0 24 24" width="16"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Button */
.styled-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #0497E7;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.styled-submit:hover {
    background: #037ac0;
}


/* ===== DROP-DOWN ===== */
/* Make select match styled inputs */
.form-field select.styled-input {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-color: #1a1a1a;
    color: #fff;

    border: 1px solid #444;
    border-radius: 4px;

    padding: 8px 12px;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;

    cursor: pointer;

    /* Custom dropdown arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

/* Remove default arrow in IE */
.form-field select::-ms-expand {
    display: none;
}


/* ===== PREVIEW ===== */
.preview-placeholder {
    text-align: center;
    color: #ccc;
    font-size: 0.95em;
}

/* This is where chart renders */
#previewStage {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* ðŸ‘ˆ CRITICAL */
}


/* ===== PRINT PREVIEW PAGE ===== */
/* Outer paper simulation */
.preview-page {
    background: #ddd;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Inner printable area */
.preview-inner {
    inset: 0;
}

/* Frame styling */
.frame-box {
    border: 2px solid #000;
    position: absolute;
    box-sizing: border-box;
}

/* Frame label */
.frame-label {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 11px;
    color: #000;
    background: #fff;
    padding: 2px 4px;
}


/* ===== FOOTER ===== */
.footer-text {
    text-align: center;
    font-size: 12px;
    color: #666;
    padding: 15px 10px;
}

.footer-divider {
    margin: 0 10px;
    color: #999;
}

.footer-link {
    color: #000;
    text-decoration: none;
    border-bottom: 1px solid #000;
    cursor: pointer;
}

.footer-link:hover {
    opacity: 0.7;
}

/* ===== MOBILE PREVIEW SCALE (CORRECTED) ===== */
@media (max-width: 600px) {

    #previewStage {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        width: 100%;
        overflow: hidden;
    }

    /* Wrapper */
    #previewStage > div {
        display: flex;
        justify-content: center;
    }

    /* The preview paper */
    #previewStage [data-paper] {
        transform-origin: top center;
        transform: scale(calc(100vw / 540)); /* slightly padded */
    }

    /* Prevent flex overflow issues */
    .framegen-panel {
        min-width: 0;
    }

    /* Form layout */
    .form-field {
        grid-template-columns: 1fr;
    }

    .form-field label {
        text-align: left;
    }

}