/* NextSpell - Modern Dark Theme CSS */
@import url('https://fonts.googleapis.com/css2?family=Nokora&display=swap');

/* Embed Khmer OS Font */
@font-face {
    font-family: 'Khmer OS';
    src: url('../KhmerOS.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Global Styles */
body {
    background-color: var(--bs-dark);
    color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Nokora', sans-serif;
}

/* Container adjustments */
.container {
    max-width: 1200px; /* Wider container, but will respect responsive breakpoints */
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    background-color: var(--bs-dark-bg-subtle);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.card-body {
    padding: 30px;
}

/* Button styling */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-custom {
    margin: 10px;
    width: 200px;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Better focus states */
.form-control:focus,
.btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(130, 138, 145, 0.25);
}

/* Text Areas - preserving original functionality */
#txtArea, #textArea {
    min-height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 10px;
    outline: none;
    white-space: pre-wrap;
    text-align: left;
    font-family: 'Nokora', sans-serif;
    background-color: var(--bs-dark);
    color: var(--bs-light);
}

#txtArea {
    font-size: 22px;
}

#textArea {
    font-size: 18px;
}

/* Placeholder Styles */
#txtArea:empty:before,
#textArea:empty:before {
    content: attr(placeholder);
    color: #6c757d;
    font-family: 'Nokora', sans-serif;
}

/* Focus States */
#txtArea:focus,
#textArea:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Image Preview */
.image-preview {
    max-width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Clipboard Fallback */
#copyTextarea {
    position: absolute;
    left: -9999px;
}

/* Feature icons */
.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto;
}

/* Responsive Keyboard Styles - preserved from original */
/* Base Keyboard Styles */
.keyboard {
    background-color: var(--bs-dark-bg-subtle);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    display: none;
    flex-direction: column;
    gap: 5px;
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.keyboard-row {
    display: flex;
    gap: 3px;
    justify-content: space-between;
    width: 100%;
    flex-wrap: nowrap; /* Prevent wrapping unless necessary */
}

.keyboard button {
    flex-grow: 1; /* Buttons grow to fill available space */
    height: 40px;
    font-family: 'Khmer OS', sans-serif;
    font-size: 16px;
    border: 1px solid #2c3034;
    background-color: var(--bs-dark);
    color: var(--bs-light);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keyboard button:hover {
    background-color: var(--bs-primary);
    color: white;
    transform: translateY(-2px);
}

/* Style for active buttons */
.keyboard button.shift-active,
.keyboard button.capslock-active {
    background-color: var(--bs-primary);
    color: white;
}

.keyboard button.backspace {
    flex-grow: 2;
}

.keyboard button.tab {
    flex-grow: 1.5;
}

.keyboard button.enter {
    flex-grow: 1.5;
}

.keyboard button.capslock {
    flex-grow: 2;
}

.keyboard button.shift {
    flex-grow: 1.5;
}

.keyboard button.spacebar {
    flex-grow: 4;
}

/* Progress bar styling */
#myBar {
    width: 0%;
    height: 20px;
    background-color: var(--bs-success);
    text-align: center;
    line-height: 20px;
    color: white;
    display: none;
    border-radius: 4px;
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Divider with text */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #6c757d;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider::before {
    margin-right: 0.5em;
}

.divider::after {
    margin-left: 0.5em;
}

/* Improved form styling */
.input-group-text {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background-color: var(--bs-dark-bg-subtle);
    border-color: rgba(255, 255, 255, 0.1);
}

.input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background-color: var(--bs-dark);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--bs-light);
}

/* Footer styling */
footer {
    margin-top: auto;
    background-color: rgba(33, 37, 41, 0.95);
}

/* Make the navbar fixed and dark with blur effect */
#mainNav {
    backdrop-filter: blur(10px);
    background-color: rgba(33, 37, 41, 0.95);
}

/* Responsive improvements */
@media (max-width: 767.98px) {
    .display-4 {
        font-size: calc(1.4rem + 1.8vw);
    }
    
    .hero-section {
        text-align: center;
    }
    
    .keyboard button {
        font-size: 14px; /* Smaller font size for mobile */
        height: 35px; /* Reduced height for mobile */
    }

    .keyboard-row {
        gap: 2px; /* Smaller gap between buttons */
    }
}

@media (max-width: 480px) {
    .keyboard button {
        font-size: 12px; /* Even smaller font size for very small screens */
        height: 30px; /* Further reduced height */
    }

    .keyboard-row {
        gap: 1px; /* Minimal gap for very small screens */
    }
}

.invoice-a4 table {
    border-collapse: collapse;
}

.invoice-a4 table th,
.invoice-a4 table td {
    border: 1px solid black;
    background-color: white;
    color: black;
}
