/*--------------------------------------------------------------
# Koligram Unicode Converter Stylesheet
--------------------------------------------------------------*/

.koligram-unicode-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: #333;
}

/* Header Section */
.unicode-header-section {
    text-align: center;
    margin-bottom: 30px;
}

.unicode-main-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a4487; /* Koligram Blue */
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.unicode-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Dual-Pane Workspace */
.unicode-workspace {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

/* Glassmorphic Panes */
.unicode-pane {
    background: #ffffff;
    border: 1px solid rgba(26, 68, 135, 0.08);
    box-shadow: 0 15px 35px rgba(26, 68, 135, 0.04), 0 5px 15px rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.unicode-pane:hover {
    box-shadow: 0 20px 45px rgba(26, 68, 135, 0.07);
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.pane-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #1a4487;
    margin: 0;
}

/* LIVE pulse indicator */
.status-indicator.live {
    background: #e6f4ea;
    color: #137333;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #137333;
    border-radius: 50%;
    display: inline-block;
    animation: pulseGlow 1.5s infinite ease-in-out;
}

@keyframes pulseGlow {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

/* Textareas styling */
.unicode-pane textarea {
    width: 100%;
    height: 250px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    padding: 15px;
    font-size: 17px;
    line-height: 1.6;
    font-family: inherit;
    resize: none;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#roman-text-input:focus {
    border-color: #1a4487;
    box-shadow: 0 0 0 3px rgba(26, 68, 135, 0.15);
}

#nepali-text-output {
    background-color: #fcfdfe;
    cursor: default;
}

/* Buttons and Footers */
.pane-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    outline: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: #1a4487;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #133366;
}

.btn-secondary {
    background-color: #f4f4f4;
    color: #444444;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background-color: #eaeaea;
}

.btn-info {
    background-color: #e8eff6;
    color: #1a4487;
    border: 1px solid rgba(26, 68, 135, 0.15);
}

.btn-info:hover {
    background-color: #d8e6f3;
}

/* Reference Guide Drawer styling */
.guide-toggle-wrapper {
    text-align: center;
    margin: 15px 0 15px;
}

.unicode-guide-drawer {
    background: #fafbfc;
    border: 1px dashed rgba(26, 68, 135, 0.2);
    border-radius: 12px;
    padding: 25px;
    margin-top: 15px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.drawer-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a4487;
    margin: 0 0 20px 0;
    text-align: center;
}

.guide-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.7fr 1.4fr;
    gap: 25px;
}

.guide-section h4 {
    font-size: 13px;
    font-weight: 700;
    color: #133366;
    margin: 0 0 10px 0;
    border-left: 3px solid #1a4487;
    padding-left: 8px;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.guide-table th {
    background-color: #f0f4f8;
    color: #1a4487;
    font-weight: 700;
    text-align: left;
    padding: 5px 8px;
    border: 1px solid #e2ecf5;
}

.guide-table td {
    padding: 5px 8px;
    border: 1px solid #e2ecf5;
    color: #444;
}

.guide-table tr:nth-child(even) td {
    background-color: #fcfdfe;
}

.guide-table td strong {
    color: #111;
}

.rule-text {
    line-height: 1.5;
    font-size: 11px;
}

.rule-text code {
    background: #e8eff6;
    color: #1a4487;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
}

/* Toast Success Popup */
.unicode-toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #137333;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(19, 115, 51, 0.25);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    pointer-events: none;
    z-index: 9999999;
}

.unicode-toast.show {
    bottom: 40px;
    opacity: 1;
}

.unicode-toast i {
    font-size: 16px;
}

/*--------------------------------------------------------------
# 5. Global Modal System
--------------------------------------------------------------*/
.unicode-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(19, 51, 102, 0.65); /* Elegant deep blue transparency */
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999; /* Higher than theme components */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.unicode-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.unicode-modal-content {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    width: 95%;
    max-width: 950px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    position: relative;
    transform: translateY(-30px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.unicode-modal-overlay.show .unicode-modal-content {
    transform: translateY(0);
}

/* Custom Scrollbar for Modal content drawer */
.unicode-modal-content::-webkit-scrollbar {
    width: 8px;
}
.unicode-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 16px 16px 0;
}
.unicode-modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
.unicode-modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.unicode-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: 300;
    color: #8c8f94;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
    z-index: 1000;
}

.unicode-modal-close:hover {
    color: #d02027; /* Koligram Red on close hover */
}

/* Responsive Overrides */
@media screen and (max-width: 900px) {
    .unicode-workspace {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .unicode-pane textarea {
        height: 200px;
    }
    
    .guide-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .unicode-main-title {
        font-size: 24px;
    }
}

@media screen and (max-width: 600px) {
    .unicode-modal-overlay {
        align-items: center; /* Center vertically on all devices */
        justify-content: center; /* Center horizontally on all devices */
    }

    .unicode-modal-content {
        width: 95%;
        max-height: 85vh; /* Safe height bounding with inner scrolling */
        border-radius: 12px; /* Premium curved card borders on mobile */
        padding: 20px 15px;
    }
    
    .unicode-modal-close {
        top: 12px;
        right: 15px;
        font-size: 28px;
    }
    
    .koligram-unicode-container {
        margin: 10px auto;
        padding: 0 5px;
    }
    
    .unicode-main-title {
        font-size: 20px;
        margin-top: 15px;
    }
    
    .unicode-pane {
        padding: 12px;
        border-radius: 8px;
    }
    
    .unicode-pane textarea {
        height: 130px; /* Compact height to fit multiple panes on viewport */
        font-size: 15px;
        padding: 10px;
    }
    
    .pane-header h2 {
        font-size: 13px;
    }
    
    .pane-footer {
        margin-top: 8px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 12px;
        width: 100%; /* Large, easy full-width tap targets */
        justify-content: center;
    }
    
    .guide-grid {
        gap: 15px;
    }
    
    .unicode-guide-drawer {
        padding: 15px;
    }
    
    .drawer-header h3 {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .guide-table {
        font-size: 11px;
    }
}
