/* Helper Tools - Complete Styles with Dark Mode */
:root {
    --ht-bg: #ffffff;
    --ht-text: #2c3e50;
    --ht-card-bg: #ffffff;
    --ht-border: #e8ecf1;
    --ht-shadow: 0 2px 20px rgba(0,0,0,0.06);
    --ht-hover-shadow: 0 8px 40px rgba(102, 126, 234, 0.15);
    --ht-header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ht-secondary-bg: #f8f9fa;
    --ht-input-bg: #ffffff;
}

.ht-dark-mode {
    --ht-bg: #1a1a2e;
    --ht-text: #e8e8e8;
    --ht-card-bg: #16213e;
    --ht-border: #2a2a4a;
    --ht-shadow: 0 2px 20px rgba(0,0,0,0.3);
    --ht-hover-shadow: 0 8px 40px rgba(102, 126, 234, 0.25);
    --ht-header-bg: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    --ht-secondary-bg: #1a1a2e;
    --ht-input-bg: #1a1a2e;
}

.ht-receipt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 1;
    overflow: hidden;
}


/* Dark Mode Toggle */
.ht-dark-mode-toggle {
    text-align: right;
    margin-bottom: 20px;
}

/* Fix for dark mode header */
.ht-dark-mode .ht-page-header h1,
.ht-dark-mode .ht-page-header p {
    color: #ffffff !important;
}

/* Fix for dark mode all text */
.ht-dark-mode h1,
.ht-dark-mode h2,
.ht-dark-mode h3,
.ht-dark-mode h4,
.ht-dark-mode p,
.ht-dark-mode label,
.ht-dark-mode .ht-stat-label,
.ht-dark-mode .ht-tool-card-content p {
    color: #e8e8e8 !important;
}

/* Fix for dark mode card titles */
.ht-dark-mode .ht-tool-card-content h2 {
    color: #ffffff !important;
}

.ht-dark-btn {
    background: var(--ht-card-bg);
    color: var(--ht-text);
    border: 2px solid var(--ht-border);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.ht-dark-btn:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

/* Container */
.ht-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--ht-bg);
    color: var(--ht-text);
    transition: all 0.3s ease;
}

/* Page Header */
.ht-page-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    background: var(--ht-header-bg);
    border-radius: 16px;
    color: white;
}

.ht-page-header h1 {
    font-size: 2.8em;
    margin: 0;
    font-weight: 800;
}

.ht-page-header p {
    font-size: 1.2em;
    margin: 15px 0 0;
    opacity: 0.9;
}

/* Tools Grid - FIXED for Desktop */
.ht-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

/* Tool Cards */
.ht-tool-card {
    background: var(--ht-card-bg);
    border-radius: 16px;
    box-shadow: var(--ht-shadow);
    padding: 25px;
    border: 1px solid var(--ht-border);
    display: flex;
    align-items: flex-start;
    gap: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.ht-tool-card:not(.ht-tool-coming-soon):hover {
    transform: translateY(-5px);
    box-shadow: var(--ht-hover-shadow);
    border-color: #667eea;
}

.ht-tool-card.ht-tool-coming-soon {
    opacity: 0.7;
    cursor: not-allowed;
}

.ht-tool-card.ht-tool-coming-soon:hover {
    transform: none;
}

.ht-tool-card-icon {
    font-size: 40px;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--ht-secondary-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ht-tool-card-content {
    flex: 1;
}

.ht-tool-card-content h2 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    color: var(--ht-text);
}

.ht-tool-card-content p {
    margin: 0 0 12px 0;
    color: var(--ht-text);
    opacity: 0.7;
    font-size: 0.9em;
    line-height: 1.5;
}

.ht-tool-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ht-tag {
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ht-tag-free {
    background: #d4edda;
    color: #155724;
}

.ht-tag-popular {
    background: #fff3cd;
    color: #856404;
}

.ht-tag-new {
    background: #cce5ff;
    color: #004085;
}

.ht-tag-coming {
    background: #e2e3e5;
    color: #383d41;
}

.ht-tool-card-action {
    flex-shrink: 0;
    align-self: center;
    padding-left: 10px;
}

.ht-arrow {
    font-size: 24px;
    color: #667eea;
    transition: transform 0.3s;
}

.ht-tool-card:not(.ht-tool-coming-soon):hover .ht-arrow {
    transform: translateX(5px);
}

/* Ad Section */
.ht-ad-section {
    margin: 40px 0;
    padding: 20px;
    background: var(--ht-secondary-bg);
    border-radius: 12px;
    border: 1px solid var(--ht-border);
    text-align: center;
}

.ht-ad-placeholder {
    padding: 20px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ht-text);
    opacity: 0.7;
}

/* Stats Section */
.ht-stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.ht-stat-box {
    background: var(--ht-secondary-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--ht-border);
}

.ht-stat-number {
    display: block;
    font-size: 2.5em;
    font-weight: 700;
    color: #667eea;
}

.ht-stat-label {
    color: var(--ht-text);
    opacity: 0.7;
    font-size: 0.9em;
}

/* CTA Section */
.ht-cta-section {
    background: var(--ht-secondary-bg);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--ht-border);
    margin: 40px 0;
}

.ht-cta-section h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    color: var(--ht-text);
}

.ht-cta-section p {
    color: var(--ht-text);
    opacity: 0.7;
    margin: 0 0 20px 0;
}

.ht-newsletter-form {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
    gap: 10px;
}

.ht-newsletter-form input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--ht-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--ht-input-bg);
    color: var(--ht-text);
}

.ht-newsletter-form input:focus {
    border-color: #667eea;
    outline: none;
}

.ht-newsletter-form button {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ht-newsletter-form button:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* About Section */
.ht-about-section {
    text-align: center;
    padding: 20px 0;
}

.ht-credit {
    color: var(--ht-text);
    opacity: 0.7;
    font-size: 0.9em;
}

.ht-credit a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.ht-credit a:hover {
    text-decoration: underline;
}

/* MODAL STYLES */
.ht-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.ht-modal-content {
    background: var(--ht-card-bg);
    margin: 40px auto;
    max-width: 700px;
    border-radius: 16px;
    padding: 30px;
    animation: htModalSlideIn 0.3s ease;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes htModalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ht-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--ht-border);
}

.ht-modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: var(--ht-text);
}

.ht-modal-close {
    font-size: 32px;
    cursor: pointer;
    color: var(--ht-text);
    opacity: 0.5;
    transition: opacity 0.3s;
    line-height: 1;
}

.ht-modal-close:hover {
    opacity: 1;
}

.ht-modal-body p {
    color: var(--ht-text);
    opacity: 0.7;
    margin-top: 0;
}

/* Modal Tool Styles */
.ht-modal-tool .ht-input-group,
.ht-modal-tool .ht-output-group {
    margin-bottom: 15px;
}

.ht-modal-tool label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ht-text);
}

.ht-modal-tool textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--ht-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    min-height: 120px;
    resize: vertical;
    transition: border-color 0.3s;
    background: var(--ht-input-bg);
    color: var(--ht-text);
}

.ht-modal-tool input:not([type="checkbox"]) {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--ht-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: var(--ht-input-bg);
    color: var(--ht-text);
}

.ht-modal-tool textarea:focus,
.ht-modal-tool input:not([type="checkbox"]):focus {
    border-color: #667eea;
    outline: none;
}

.ht-modal-tool .ht-output-group textarea {
    background: var(--ht-secondary-bg);
}

.ht-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.ht-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ht-btn-primary {
    background: #667eea;
    color: white;
}

.ht-btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ht-btn-success {
    background: #28a745;
    color: white;
}

.ht-btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.ht-btn-secondary {
    background: #6c757d;
    color: white;
}

.ht-btn-secondary:hover {
    background: #5a6268;
}

.ht-btn-info {
    background: #17a2b8;
    color: white;
}

.ht-btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.ht-modal-tool hr {
    margin: 25px 0;
    border: none;
    border-top: 2px solid var(--ht-border);
}

.ht-modal-tool h3 {
    color: var(--ht-text);
    margin-top: 0;
}

/* Modal Stats */
.ht-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.ht-stat-item {
    text-align: center;
    padding: 12px;
    background: var(--ht-secondary-bg);
    border-radius: 8px;
    border: 1px solid var(--ht-border);
}

.ht-stat-number {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: #667eea;
}

.ht-stat-label {
    color: var(--ht-text);
    opacity: 0.7;
    font-size: 0.85em;
}

/*  SEO Results */
.ht-seo-result {
    background: var(--ht-secondary-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--ht-border);
}

.ht-seo-result h4 {
    margin: 0 0 8px 0;
    color: var(--ht-text);
}

.ht-seo-output {
    font-size: 16px;
    padding: 10px;
    background: var(--ht-input-bg);
    border-radius: 4px;
    border: 1px solid var(--ht-border);
    word-wrap: break-word;
    color: var(--ht-text);
}

.ht-seo-result small {
    display: block;
    margin-top: 5px;
    color: var(--ht-text);
    opacity: 0.6;
    font-size: 12px;
}

/* Receipt Form Grid */
.ht-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.ht-form-grid .ht-input-group {
    margin-bottom: 0;
}

/* Receipt Preview */
.ht-receipt-preview {
    margin: 15px 0;
}

/* Receipt preview fixes for print/download */
.ht-receipt-preview {
    max-width: 100%;
}

.ht-receipt-preview div[style*="font-size: 28px"] {
    font-size: 28px !important;
    line-height: 1 !important;
}

.ht-receipt-preview div[style*="font-size: 14px"] {
    font-size: 14px !important;
}

.ht-receipt-preview span[style*="font-size: 14px"] {
    font-size: 14px !important;
}

/* Fix for dark mode checkboxes */
.ht-checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.ht-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #667eea;
}

/* Dark mode checkbox fixes */
.ht-dark-mode .ht-checkbox-group label {
    background: #1a1a2e;
    border-color: #2a2a4a;
    color: #e8e8e8;
}

.ht-dark-mode .ht-checkbox-group label:hover {
    border-color: #667eea;
}

.ht-dark-mode .ht-checkbox-group input[type="checkbox"] {
    accent-color: #667eea;
}

.ht-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    font-size: 13px;
    color: var(--ht-text);
    cursor: pointer;
    padding: 6px 12px;  /* Reduced from 8px to 6px */
    background: var(--ht-secondary-bg);
    border-radius: 6px;  /* Reduced from 8px to 6px */
    border: 1px solid var(--ht-border);
    transition: all 0.3s;
    min-height: 36px;  /* Added fixed min-height  */
}

.ht-checkbox-group label:hover {
    border-color: #667eea;
}


.ht-donate-line {
    margin-top: 8px;
    font-size: 0.85em;
}

.ht-donate-line a {
    color: #28a745;
    text-decoration: none;
    font-weight: 600;
}

.ht-donate-line a:hover {
    text-decoration: underline;
}

/* Responsive checkboxes */
@media (max-width: 480px) {
    .ht-checkbox-group {
        grid-template-columns: 1fr;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .ht-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ht-page-header h1 {
        font-size: 2em;
    }
    
    .ht-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .ht-tool-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .ht-tool-card-icon {
        width: 50px;
        height: 50px;
        font-size: 30px;
    }
    
    .ht-tool-tags {
        justify-content: center;
    }
    
    .ht-modal-content {
        margin: 20px;
        padding: 20px;
    }
    
    .ht-newsletter-form {
        flex-direction: column;
    }
    
    .ht-stats-section {
        grid-template-columns: 1fr 1fr;
    }
    
    .ht-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ht-stats-section {
        grid-template-columns: 1fr;
    }
    
    .ht-button-group {
        flex-direction: column;
    }
    
    .ht-btn {
        width: 100%;
        justify-content: center;
    }
}