/* /saas-frontend/shared/css/main.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #9ab6c1;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.main-nav {
    background: #4a5c6a;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
}

.logo img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 8px;
}

.logo-placeholder {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 8px;
    background: #dfeef4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #4a5c6a;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a, .nav-links button {
    color: #dfeef4;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
}

.nav-links a:hover, .nav-links button:hover, .nav-links a.active, .nav-links button.active {
    background: #3a4c5a;
    color: white;
}

/* UPDATED: Yellow Subscribe Button */
.nav-links .btn-subscribe {
    background: #f3fa3e;
    color: #212529;
    font-weight: 600;
}

.nav-links .btn-subscribe:hover {
    background: #d4e635;;
    color: #212529;
}

/* Header */
.header {
    background: #dfeef4;
    padding: 30px;
    margin: 20px 0;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header h1 {
    color: #4a5c6a;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    color: #6b8491;
    font-size: 1.2em;
}

/* Tab System */
.tab-container {
    background: #dfeef4;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: #4a5c6a;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    color: #dfeef4;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    border-right: 1px solid #3a4c5a;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button:hover {
    background: #3a4c5a;
}

.tab-button.active {
    background: #dfeef4;
    color: #4a5c6a;
}

.tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5c6a;
    font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #c8d8df;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #4a5c6a;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Premium Feature Indicator */
.premium-indicator {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
    display: inline-block;
}

.disabled-option {
    color: #999 !important;
    background: #f5f5f5 !important;
}

/* Buttons */
.btn {
    background: #4a5c6a;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background: #3a4c5a;
    transform: translateY(-2px);
}

.btn-primary {
    background: #4a5c6a;
    font-size: 18px;
    padding: 15px 30px;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Auth Required Message */
.auth-required {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    display: none;
}

/* Usage Counter */
.usage-counter {
    background: #e3f2fd;
    border: 1px solid #2196F3;
    color: #1976D2;
    padding: 10px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    font-weight: 500;
}

/* Results */
.results {
    margin-top: 30px;
    padding: 20px;
    background: #c8d8df;
    border: 2px solid #6b8491;
    border-radius: 10px;
    display: none;
}

/* Pro Features Section */
.pro-features {
    background: #4a5c6a;
    color: white;
    padding: 25px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.pro-features-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    min-height: 300px;
}

.features-table {
    flex: 2;
}

.features-ad {
    flex: 1;
    min-height: 250px;
    min-width: 300px;
}

.pro-features h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
}

/* Feature Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.comparison-table th {
    background: #f8f9fa;
    color: #4a5c6a;
    font-weight: bold;
}

.comparison-table td {
    color: #333;
}

.tier-free { background: #f8f9fa; }
.tier-basic { background: #e3f2fd; }
.tier-gold { background: #fff3e0; }
.tier-ultimate { background: #f3e5f5; }

.upgrade-button {
    background: white;
    color: #4a5c6a;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.upgrade-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

/* Related Tools */
.related-tools {
    background: #dfeef4;
    padding: 25px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.related-tools h3 {
    color: #4a5c6a;
    margin-bottom: 20px;
    text-align: center;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.tool-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #4a5c6a;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-decoration: none;
    color: #4a5c6a;
}

/* Footer */
.main-footer {
    background: #4a5c6a;
    color: #dfeef4;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #dfeef4;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #3a4c5a;
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
}

/* FIXED AdSense Containers */
.ad-container {
    margin: 20px 0;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 10px;
    display: block;
    min-height: 50px;
    min-width: 300px;
    overflow: hidden;
}

.ad-container.leaderboard {
    min-height: 100px;
    min-width: 728px;
    max-width: 728px;
    margin: 20px auto;
}

.ad-container.rectangle {
    min-height: 260px;
    min-width: 300px;
    max-width: 300px;
}

/* FIXED: Use visibility instead of display for hiding */
.ad-container.hidden {
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}

/* Style the actual AdSense units - FIXED */
.adsbygoogle {
    display: block !important;
    min-width: inherit;
    min-height: inherit;
}

/* FAQ Styles */
.faq-item {
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.faq-question {
    background: #4a5c6a;
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: #3a4c5a;
}

.faq-answer {
    padding: 20px;
    color: #4a5c6a;
    line-height: 1.6;
    display: none;
}

/* How-to Steps */
.step {
    background: white;
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #4a5c6a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.step-number {
    background: #4a5c6a;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #dfeef4;
    padding: 30px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
}

.modal h3 {
    margin-bottom: 20px;
    color: #4a5c6a;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-cancel {
    background: #6c757d;
}

.btn-cancel:hover {
    background: #545b62;
}

/* User Info Display */
.user-info {
    color: #dfeef4;
    font-size: 14px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a5c6a;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        gap: 15px;
    }

    .header h1 {
        font-size: 2em;
    }

    .tab-buttons {
        flex-direction: column;
    }

    .tab-button {
        border-right: none;
        border-bottom: 1px solid #3a4c5a;
    }

    .pro-features-content {
        flex-direction: column;
        min-height: auto;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .comparison-table {
        font-size: 14px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px 4px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .ad-container.leaderboard {
        min-width: 320px;
        max-width: 100%;
    }
}

/* Processing States */
.processing {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* Free Usage Indicator */
.free-usage-indicator {
    background: #e8f4f8;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    text-align: center;
}

.usage-text {
    display: block;
    color: #0c5460;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.usage-bar {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #ffc107);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Message animations */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Messages */
@media (max-width: 768px) {
    .error-message,
    .success-message,
    .info-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        position: fixed;
    }
}