/* ---- RECOMMENDATION PAGE STYLES ---- */
@import url('base.css');

/* Root Layout & Scroll Override */
body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header bar */
.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: var(--blur-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    height: 70px;
    flex-shrink: 0;
}

.rec-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rec-logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.3s;
}

.rec-logo:hover {
    opacity: 0.8;
}

.rec-header-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    border-left: 1.5px solid var(--border);
    padding-left: 1rem;
    margin: 0;
    font-weight: 400;
}

.rec-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Action Buttons */
.rec-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    text-decoration: none;
    user-select: none;
}

.rec-btn:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.rec-btn:active {
    transform: translateY(0);
}

.rec-btn-primary {
    background: var(--gradient-primary);
    color: var(--text-light);
    border: none;
    box-shadow: var(--shadow-glow);
}

.rec-btn-primary:hover {
    background: var(--gradient-hover);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.25);
}

.rec-btn-secondary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.rec-btn-secondary:hover {
    background: rgba(79, 70, 229, 0.08);
}

.rec-btn-icon {
    padding: 0.6rem;
    border-radius: 50%;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
}

/* Container Area */
.rec-container {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    height: calc(100vh - 70px);
}

/* Views (PDF vs HTML) */
.rec-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    transform: scale(0.98);
}

.rec-view.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* PDF View */
.rec-pdf-view {
    padding: 0;
    background: #525659;
}

html[data-theme="dark"] .rec-pdf-view {
    background: #0f172a;
}

.rec-pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* HTML Translation View */
.rec-html-view {
    overflow-y: auto;
    padding: 3rem 1.5rem;
    background: var(--bg);
}

/* Paper Document styling for the Letter */
.rec-letter-paper {
    max-width: 850px;
    margin: 0 auto;
    background: var(--bg-card);
    color: var(--text);
    padding: 5rem 4.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    position: relative;
    line-height: 1.7;
    font-size: 0.95rem;
}

html[data-theme="dark"] .rec-letter-paper {
    box-shadow: var(--shadow-glow);
}

/* Letterhead styles */
.letterhead-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px dashed var(--border);
    padding-bottom: 1.5rem;
}

.letterhead-sender {
    flex: 1.2;
}

.sender-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.letterhead-info {
    text-align: right;
    flex: 0.8;
}

.letterhead-info p {
    margin-bottom: 0.15rem;
}

/* Date and Subject */
.letterhead-meta {
    margin-bottom: 2rem;
}

.letterhead-date {
    text-align: right;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.letterhead-subject {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 2rem;
    color: var(--text);
}

/* Letter body */
.letterhead-body {
    text-align: justify;
}

.letterhead-body p {
    margin-bottom: 1.5rem;
}

.letterhead-body strong {
    color: var(--primary);
    font-weight: 600;
}

/* Footnotes inside letter */
.letterhead-footnotes {
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.letterhead-footnotes ol {
    padding-left: 1.2rem;
}

.letterhead-footnotes li {
    margin-bottom: 0.4rem;
}

.letterhead-footnotes a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s;
}

.letterhead-footnotes a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Signatures grid */
.letterhead-signatures {
    margin-top: 4rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem 2rem;
    border-top: 1px dashed var(--border);
    padding-top: 2rem;
}

.signature-block {
    display: flex;
    flex-direction: column;
}

.signature-primary {
    grid-column: span 2;
    margin-bottom: 1.5rem;
}

.signature-title {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.signature-role {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Mobile responsive layout */
@media (max-width: 768px) {
    .rec-header {
        padding: 0.75rem 1rem;
        height: auto;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .rec-header-left {
        width: 100%;
        justify-content: space-between;
    }
    
    .rec-header-title {
        display: none;
    }
    
    .rec-header-actions {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .rec-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        flex-grow: 1;
        justify-content: center;
    }
    
    .rec-container {
        height: calc(100vh - 118px);
    }
    
    .rec-html-view {
        padding: 1.5rem 0.75rem;
    }
    
    .rec-letter-paper {
        padding: 3rem 1.5rem;
        font-size: 0.9rem;
        border-radius: var(--radius-sm);
    }
    
    .letterhead-header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
        text-align: left;
    }
    
    .letterhead-info {
        text-align: left;
    }
    
    .letterhead-signatures {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .signature-primary {
        grid-column: span 1;
    }
}
