/* ==========================================
   GLOBAL STYLES & VARIABLE THEMING
   ========================================== */
:root {
    --bg-workspace: #f4f6f8;
    --panel-bg: #ffffff;
    --primary: #27ae60;
    --primary-hover: #219653;
    --primary-glow: rgba(39, 174, 96, 0.1);
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --border-focus: #27ae60;
    
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-workspace);
    color: var(--text-main);
    padding: 40px 20px;
    -webkit-font-smoothing: antialiased;
}

.workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 1300px; margin: 0 auto; position: relative; }

/* FORM STYLING */
.form-panel { background: var(--panel-bg); padding: 45px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.section-title { font-size: 1.05rem; color: var(--primary); font-weight: 700; border-bottom: 2px solid #f1f5f9; padding-bottom: 10px; margin: 40px 0 24px 0; text-transform: uppercase; letter-spacing: 0.08em; }
.section-title:first-child { margin-top: 0; }
.form-group { margin-bottom: 24px; position: relative; }
label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.9rem; color: #334155; }
.rule-note { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; margin-left: 4px; }

input[type="text"], input[type="number"], textarea {
    width: 100%; padding: 14px 16px; border: 1.5px solid var(--border-color); border-radius: var(--radius-md); font-family: inherit; font-size: 0.95rem; outline: none; transition: all 0.25s ease;
}
input:focus, textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 4px var(--primary-glow); }
textarea { resize: vertical; height: 110px; line-height: 1.5; }

select {
    width: 100%; padding: 14px 40px 14px 16px; border: 1.5px solid var(--border-color); border-radius: var(--radius-md); font-family: inherit; font-size: 0.95rem; cursor: pointer; transition: all 0.25s ease;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; background-color: #fff;
}
select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 4px var(--primary-glow); }

.submit-btn {
    background-color: var(--primary); color: white; border: none; padding: 16px; font-size: 1rem; font-weight: 700; border-radius: var(--radius-md); cursor: pointer; width: 100%; margin-top: 24px; box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2); transition: all 0.2s ease;
}
.submit-btn:hover { background-color: var(--primary-hover); transform: translateY(-1px); }

button[type="button"] { background-color: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; padding: 10px 16px; font-size: 0.88rem; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s ease; }
button[type="button"]:hover { background-color: #e2e8f0; color: #1e293b; }

/* PREVIEW CARD STYLING */
.preview-wrapper { position: sticky; top: 40px; height: calc(100vh - 80px); overflow-y: auto; border-radius: var(--radius-lg); padding-right: 8px; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.card { background: var(--panel-bg); width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid #e2e8f0; overflow: hidden; }
.card-header { background: #1e293b; padding: 45px 35px; text-align: center; color: white; transition: background-color 0.35s ease; }
.icon-container { width: 84px; height: 84px; background: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; margin: 0 auto 20px auto; box-shadow: 0 8px 20px rgba(0,0,0,0.12); color: #1e293b; }
.card-header h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.card-header p { font-size: 0.95rem; opacity: 0.85; margin-bottom: 6px; }
.card-body { padding: 35px; }
.card-section { margin-bottom: 28px; padding: 12px 16px; border-radius: var(--radius-md); border-left: 3px solid transparent; transition: all 0.4s ease; }
.card-section.highlight { background-color: #f0fdf4; border-left-color: var(--primary); }
.section-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; margin-bottom: 6px; }
.section-content { font-size: 0.98rem; color: #334155; line-height: 1.6; }
.placeholder { color: #cbd5e1; font-style: italic; }
.meta-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; padding: 0 12px; }
.tag { background: #f8fafc; color: #475569; padding: 8px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; border: 1px solid #e2e8f0; display: inline-flex; align-items: center; gap: 6px; }
.hidden { display: none !important; }

/* ==========================================
   THE FEEDBACK SYSTEM STYLES (REVIEWER MODE)
   ========================================== */

/* Hide feedback elements by default */
.feedback-ui { display: none; }
.feedback-flag { display: none; float: right; color: #cbd5e1; cursor: pointer; padding: 2px; transition: color 0.2s; }

/* When Reviewer Mode is ON via the body class */
body.reviewer-active .feedback-ui { display: block; }
body.reviewer-active .feedback-flag { display: inline-block; }
body.reviewer-active .feedback-flag:hover { color: #f59e0b; } /* Amber hover */
.feedback-flag.has-comment { color: #f59e0b; } /* Stays amber if they left feedback */

/* Inline text box that drops down below a label */
.inline-comment-box {
    margin-top: 8px;
    margin-bottom: 12px;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    padding: 10px;
}
.inline-comment-box input {
    border: 1px dashed #fcd34d; background: white; padding: 8px; border-radius: 4px;
}
.inline-comment-box input:focus { border-color: #f59e0b; box-shadow: none; }

/* The Global Amber Box */
.global-feedback-box {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 40px;
}
.global-feedback-box h4 { color: #b45309; margin-bottom: 4px; }
.global-feedback-box p { color: #d97706; font-size: 0.85rem; margin-bottom: 12px; }
.global-feedback-box textarea { border-color: #fcd34d; }
.global-feedback-box textarea:focus { border-color: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1); }

/* Floating Toggle Switch UI */
.reviewer-toggle-wrapper {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 32px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

/* Explicit visual reminder that the mode is ON */
body.reviewer-active .reviewer-toggle-wrapper {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    box-shadow: 0 10px 40px rgba(245, 158, 11, 0.25);
}

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .3s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
input:checked + .slider { background-color: #f59e0b; } 
input:checked + .slider:before { transform: translateX(20px); }


/* Card Feedback Footer */
.card-feedback-footer {
    background: #f8fafc; border-top: 1px solid #e2e8f0; padding: 20px 35px;
    display: flex; justify-content: space-between; align-items: center;
}
.thumb-group { display: flex; gap: 10px; }
.thumb-btn { 
    background: white; border: 1px solid #cbd5e1; border-radius: 50%; width: 44px; height: 44px; 
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: #64748b; transition: all 0.2s;
}
.thumb-btn:hover { background: #f1f5f9; color: #1e293b; }
.thumb-btn.selected { background: #f59e0b; color: white; border-color: #f59e0b; box-shadow: 0 4px 10px rgba(245,158,11,0.2); }