/* Landing Page & Cards */
.proposal-landing {
    margin: 0 auto;
}

.landing-hero-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px 28px;
    margin: 24px 0 32px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.hero-header-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--color-orange-ink);
    margin-bottom: 12px;
}

.landing-hero-card .intro-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--color-grey-600);
    margin: 0;
}

.landing-hero-card .intro-text strong {
    color: var(--color-ink);
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feat-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.feat-card h3 {
    color: var(--color-orange-ink);
    font-size: 18px;
    margin-bottom: 10px;
}

.btn-large {
    font-size: 18px;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
}

/* Button Redesign for Professional & Premium Look */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1.3;
    outline: none;
}

.btn:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 2px;
}

.btn-primary {
    background: #4A3E38;
    color: #ffffff !important;
    border-color: #4A3E38;
    border-radius: 999px;
    box-shadow: 0 2px 4px rgba(74, 62, 56, 0.2);
}

.btn-primary:hover {
    background: #382e29;
    border-color: #382e29;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(56, 46, 41, 0.3);
    transform: translateY(-1.5px);
}

.btn-secondary {
    background: var(--color-card);
    color: var(--color-ink) !important;
    border: 1px solid var(--color-border);
    border-radius: 999px;
}

.btn-secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-ink);
    transform: translateY(-1.5px);
}

.btn-outline-secondary {
    background: #ffffff;
    color: #334155 !important;
    border: 1.5px solid #94a3b8;
    font-weight: 600;
}

.btn-outline-secondary:hover {
    background: var(--color-bg);
    color: #0284c7 !important;
    border-color: #0284c7;
    transform: translateY(-1.5px);
}

.btn-success {
    background: #16a34a;
    color: #ffffff !important;
    border-color: #16a34a;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);
    transform: translateY(-1.5px);
}

.btn-danger {
    background: #dc2626;
    color: #ffffff !important;
    border-color: #dc2626;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
    transform: translateY(-1.5px);
}

.btn-outline-danger {
    background: #ffffff;
    color: #dc2626 !important;
    border: 1.5px solid #dc2626;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.1);
    transition: all 0.2s ease-in-out;
}

.btn-outline-danger:hover {
    background: #dc2626;
    color: #ffffff !important;
    border-color: #dc2626;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.25);
    transform: translateY(-1.5px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 5px;
}

.btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.note-text {
    font-size: 13px;
    color: #718096;
    margin-top: 10px;
}

/* Workspace Dashboard */
.proposal-workspace {
    margin: 0 auto;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.student-info-panel h2 {
    margin: 0 0 8px 0;
    color: #2d3748;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.content .badge {
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.badge-separator {
    color: #cbd5e1;
    font-size: 12px;
}

.approved-badge,
.draft-badge,
.rejected-badge,
.submitted-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.approved-badge {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.draft-badge {
    background: var(--color-bg);
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.rejected-badge {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.submitted-badge {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.proposal-card.is-approved {
    border-color: #86efac;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.proposal-card.is-rejected {
    border-color: #fca5a5;
    background: linear-gradient(180deg, #ffffff 0%, #fff5f5 100%);
}

.proposal-card.is-submitted {
    border-color: #a5b4fc;
    background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
}

.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.proposal-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.proposal-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    width: 100%;
    transition: all 0.2s ease;
}

.proposal-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.proposal-card .card-body {
    padding: 24px;
}

.prop-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 14px;
    color: #2d3748;
}

.prop-meta {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.7;
}

.proposal-card .card-actions {
    background: var(--color-bg);
    padding: 14px 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid #edf2f7;
    gap: 10px;
    flex-wrap: wrap;
}

.proposal-card .card-actions .btn {
    font-size: 13.5px;
    padding: 8px 18px;
    text-align: center;
    white-space: nowrap;
    border-radius: 6px;
}

.empty-state {
    text-align: center;
    background: #fff;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px;
    margin-top: 20px;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

/* Tabs and Forms */
.form-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 25px;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 10px;
}

.form-tab-btn,
.content .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.form-tab-btn {
    padding: 10px 18px;
    outline: none;
}

.form-tab-btn svg,
.content .tab-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.form-tab-btn:hover,
.content .tab-btn:hover {
    background: #edf2f7;
    color: #2d3748;
}

.form-tab-btn.active {
    background: #4A463F;
    color: #fff;
    border-color: #4A463F;
    box-shadow: 0 2px 4px rgba(74, 70, 63, 0.15);
}

/* OTP tab and button overrides */
.content .tab-btn {
    justify-content: center;
    padding: 8px 16px;
    flex: 1;
}

.content .tab-btn.active {
    background: #4A463F;
    color: #fff;
    border-color: #4A463F;
}

.content .btnOTP {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #4A463F;
    color: #fff;
    border: 1px solid #4A463F;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(74, 70, 63, 0.15);
}

.content .btnOTP svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

.content .btnOTP.small svg {
    width: 14px;
    height: 14px;
}

.content .btnOTP:hover {
    background: #3a362e;
    border-color: #3a362e;
    box-shadow: 0 4px 6px rgba(58, 54, 46, 0.25);
}

.content .btnOTP.small {
    padding: 8px 16px;
    font-size: 13px;
    width: auto;
}

.content .btnOTP.outline {
    background: transparent;
    color: #4A463F;
    border-color: #4A463F;
    box-shadow: none;
}

.content .btnOTP.outline:hover {
    background: var(--color-bg);
    color: #3a362e;
}

.form-tab-content {
    display: none;
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    margin-bottom: 30px;
}

.form-tab-content.active {
    display: block;
}

.form-row {
    margin-bottom: 20px;
    width: 100%;
}

.form-row.split-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row.split-2 {
        grid-template-columns: 1fr;
    }
}

.form-row label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.form-row textarea,
.form-row select,
.form-row input[type="text"],
.form-row input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-row textarea:focus,
.form-row select:focus,
.form-row input:focus {
    border-color: #4A463F;
    box-shadow: 0 0 0 3px rgba(74, 70, 63, 0.15);
}

.form-help-text {
    font-size: 14px;
    color: #718096;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Timeline Table */
.timeline-table-wrapper {
    overflow-x: auto;
}

.timeline-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.timeline-table th,
.timeline-table td {
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: right;
}

.timeline-table th {
    background: #f7fafc;
    font-weight: bold;
    color: #2d3748;
}

.timeline-table input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.timeline-table input:focus {
    border-color: var(--color-orange);
    outline: none;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

/* Actions Bar */
.form-actions-bar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px 20px;
}

@media (max-width: 600px) {
    .form-actions-bar .btn {
        width: 100%;
    }
}

/* References Manager Style system */
.references-manager-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 15px;
}

@media (max-width: 800px) {
    .references-manager-grid {
        grid-template-columns: 1fr;
    }
}

.search-results-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}

.lib-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #edf2f7;
    transition: background-color 0.2s;
    font-size: 14px;
    text-align: right;
}

.lib-result-item:hover {
    background-color: #edf2f7;
}

.lib-result-item .lib-author {
    color: #718096;
    font-size: 12px;
    margin-top: 3px;
    display: block;
}

.manual-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #a0aec0;
    font-size: 12px;
    margin: 25px 0;
}

.manual-separator::before,
.manual-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px dashed #e2e8f0;
}

.manual-separator span {
    padding: 0 10px;
    font-weight: 600;
}

.references-list-container {
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: var(--color-bg);
    padding: 15px;
    min-height: 150px;
}

.added-ref-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.01);
}

.added-ref-item:last-child {
    margin-bottom: 0;
}

.added-ref-item .ref-meta {
    text-align: right;
    flex: 1;
    padding-left: 10px;
}

.added-ref-item .ref-title {
    font-weight: bold;
    color: #2d3748;
    font-size: 14px;
    margin-bottom: 4px;
}

.added-ref-item .ref-author {
    color: #4a5568;
    font-size: 13px;
    margin-bottom: 2px;
}

.added-ref-item .ref-pub {
    color: #718096;
    font-size: 11px;
}

.btn-remove {
    background: none;
    border: none;
    color: #e53e3e;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-remove:hover {
    background-color: #fff5f5;
}

/* Custom Logout Modal styling */
.confirm-modal-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: fadeInScale 0.25s ease-out;
}

.confirm-modal-icon {
    font-size: 40px;
    color: #e53e3e;
    margin-bottom: 15px;
}

.confirm-modal-card h3 {
    margin: 0 0 10px 0;
    color: var(--color-ink);
    font-size: 20px;
}

.confirm-modal-card p {
    color: var(--color-muted);
    font-size: 14.5px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-modal-actions .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
}

/* Structure Builder Style system */
.structure-builder-wrapper {
    margin-top: 15px;
    background: var(--color-bg);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.structure-builder-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

/* Base Card Style for Chapter/General Section */
.struct-item-card {
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    position: relative;
    transition: all 0.2s ease-in-out;
}

.struct-item-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-color: #a0aec0;
}

.struct-item-card.chapter-card {
    border-right: 5px solid var(--color-orange);
}

.struct-item-card.prelude-card {
    border-right: 5px solid var(--color-muted);
}

.struct-item-card.part-card {
    border-right: 5px solid var(--color-orange-ink);
}

.struct-item-card.general-card {
    border-right: 5px solid var(--color-dim);
}

.struct-item-card.indexes-card {
    border-right: 5px solid var(--color-orange);
    background: linear-gradient(135deg, #fffbeb 0%, #fdeee1 100%);
}

/* Structure Mode Toggle */
.struct-mode-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.proposal-tips-banner {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-right: 5px solid var(--color-orange);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 22px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.proposal-tips-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-ink);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.proposal-tips-list {
    margin: 0;
    padding-right: 20px;
    color: var(--color-grey-600);
    font-size: 14px;
    line-height: 1.7;
}

.proposal-tips-list li {
    margin-bottom: 4px;
}

.proposal-tips-list li:last-child {
    margin-bottom: 0;
}

.struct-mode-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-grey-600);
    white-space: nowrap;
}

.struct-mode-toggle {
    display: flex;
    background: var(--color-border);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.struct-mode-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-muted);
    background: transparent;
    display: flex;
    align-items: center;
    gap: 7px;
}

.struct-mode-btn.active {
    background: #fff;
    color: var(--color-ink);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.struct-mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
    color: var(--color-ink);
}

#modeBtn_abwab.active {
    color: var(--color-orange-ink);
}

#modeBtn_fosool.active {
    color: var(--color-orange);
}

/* Card Headers */
.struct-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.struct-card-title-text {
    font-weight: 700;
    color: var(--color-ink);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.struct-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Inputs styling */
.struct-input-field {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.struct-input-field:focus {
    border-color: #4A463F;
    box-shadow: 0 0 0 3px rgba(74, 70, 63, 0.15);
}

/* Nested section styles */
.sections-container {
    margin-top: 15px;
    margin-right: 25px;
    /* Indent for RTL */
    border-right: 2px dashed #cbd5e0;
    padding-right: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-item-block {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-right: 4px solid #38a169;
    border-radius: 6px;
    padding: 12px;
}

/* Nested subsection styles */
.subsections-container {
    margin-top: 10px;
    margin-right: 25px;
    /* Indent for RTL */
    border-right: 2px dashed #a0aec0;
    padding-right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subsection-item-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-right: 4px solid #dd6b20;
    border-radius: 4px;
    padding: 10px;
}

/* Small UI action buttons */
.btn-struct-action {
    background: none;
    border: 1px solid #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-struct-action:hover {
    background-color: #edf2f7;
    color: #2d3748;
}

.btn-struct-action.danger {
    color: #e53e3e;
    border-color: #fed7d7;
}

.btn-struct-action.danger:hover {
    background-color: #fff5f5;
    border-color: #feb2b2;
}

/* Toolbar Style */
.structure-builder-toolbar {
    display: flex;
    gap: 10px;
    background: #edf2f7;
    padding: 12px;
    border-radius: 6px;
    justify-content: center;
}