/* Flora API - Unified Styles */

/* ===========================
   Base & Reset
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #2d3748;
}

ul {
    text-align: left;
    margin: 24px;
}

/* ===========================
   Navigation
   =========================== */
.navbar {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #2d5a27;
    font-weight: 700;
    font-size: 1.3rem;
}

.nav-logo-img {
    width: 40px;
    height: 40px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: auto;
}

.hamburger {
    width: 25px;
    height: 2px;
    background: #2d5a27;
    position: relative;
    transition: all 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 2px;
    background: #2d5a27;
    transition: all 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: #2d3748;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #2d5a27;
}

.nav-link-login {
    color: #2d5a27;
}

.nav-auth,
.nav-auth-logged-in {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-btn {
    background: #2d5a27;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.3s;
    white-space: nowrap;
}

.nav-btn:hover {
    background: #1f4019;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        max-height: 400px;
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-auth,
    .nav-auth-logged-in {
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 10px 20px 20px;
    }

    .nav-link-login {
        border: none;
        padding: 10px 0;
    }

    .nav-btn {
        width: 100%;
        text-align: center;
    }
}

/* ===========================
   Layout Containers
   =========================== */
.container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    padding: 40px;
}

.container-wide {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ===========================
   Auth Pages (Login/Register/Verify)
   =========================== */
body.auth-page {
    background: linear-gradient(135deg, #2d5a27, #4a7c59);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.verify-page {
    color: white;
}

/* ===========================
   Dashboard Layout
   =========================== */
body.dashboard-page {
    background: #f5f5f5;
}

body.admin-dashboard {
    background: #f5f7fa;
}

.header {
    background: white;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: #1a202c;
}

/* ===========================
   Typography
   =========================== */
h1 {
    color: #2d5a27;
    margin-bottom: 10px;
    font-size: 2rem;
}

h2 {
    color: #2d5a27;
}

h3 {
    margin-bottom: 15px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

/* ===========================
   Forms
   =========================== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #2d5a27;
}

/* ===========================
   Buttons
   =========================== */
button {
    width: 100%;
    background: #2d5a27;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #1f4019;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.cta-button {
    background: #ff6b35;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    width: auto;
}

.cta-button:hover {
    background: #e55a2b;
}

.upgrade-btn {
    background: #ff6b35;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    width: auto;
}

.upgrade-btn:hover {
    background: #e55a2b;
}

.upgrade-btn.current-plan {
    color: #ff6b35;
    background: none;
    cursor: default;
    border: 1px solid #ff6b35;
}

.upgrade-btn.current-plan:hover {
    background: none;
}

.copy-button {
    background: #6c757d;
    margin-top: 10px;
    padding: 8px 16px;
    width: auto;
    font-size: 0.9rem;
}

.copy-button:hover {
    background: #5a6268;
}

.manage-btn {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    width: auto;
}

.logout-btn {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    width: auto;
}

.refresh-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    width: auto;
}

.refresh-btn:hover {
    background: #3182ce;
}

.dialog-btn {
    background: #4CAF50;
    color: white;
    padding: 12px 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: auto;
}

.dialog-btn:hover {
    background: #45a049;
}

/* ===========================
   Cards
   =========================== */
.card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-card h3 {
    font-size: 0.875rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-card h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

.pricing-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.pricing-card.featured {
    border: 3px solid #ff6b35;
    transform: scale(1.05);
}

.pricing-card.current {
    border: 2px solid #4CAF50;
    background: #f1f8f4;
}

.table-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-card h2 {
    padding: 1.5rem;
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
}

/* ===========================
   Landing Page Sections
   =========================== */
.hero {
    background: linear-gradient(135deg, #2d5a27, #4a7c59);
    color: white;
    padding: 100px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: white;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.features {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature {
    text-align: center;
    padding: 30px;
}

.feature h3 {
    color: #2d5a27;
    margin-bottom: 15px;
}

.pricing {
    background: #f8f9fa;
    padding: 80px 20px;
}

/* ===========================
   Grids
   =========================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 40px auto 0;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ===========================
   Special Boxes & Alerts
   =========================== */
.api-key-box {
    background: #f8f9fa;
    border: 2px dashed #6c757d;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    font-size: 0.9rem;
}

.success-box {
    display: none;
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
}

.success-box h3 {
    color: #155724;
    margin-bottom: 15px;
}

.success {
    background: #d4edda;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    color: #155724;
}

.warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #856404;
}

.error {
    background: #f8d7da;
    border: 1px solid #dc3545;
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
    color: #721c24;
    display: none;
}

/* ===========================
   Badges & Tags
   =========================== */
.tier-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.tier-free {
    background: #e0e0e0;
    color: #666;
}

.tier-developer {
    background: #4CAF50;
    color: white;
}

.tier-professional {
    background: #2196F3;
    color: white;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-free {
    background: #e2e8f0;
    color: #4a5568;
}

.badge-developer {
    background: #bee3f8;
    color: #2c5282;
}

.badge-professional {
    background: #9ae6b4;
    color: #22543d;
}

.badge-enterprise {
    background: #fbd38d;
    color: #744210;
}

/* ===========================
   Usage & Progress Bars
   =========================== */
.usage-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.usage-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s;
}

.usage-bar.loading .usage-fill {
    background: linear-gradient(
        90deg,
        #b3b8b2 0%,
        #d6dad5 20%,
        #f5f5f5 40%,
        #d6dad5 60%,
        #b3b8b2 100%
    );
    background-size: 200% 100%;
    animation: loading-shimmer 1.8s ease-in-out infinite;
    width: 100% !important;
}

/* ===========================
   Code Display
   =========================== */
.code-example {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    overflow-x: auto;
}

/* ===========================
   Pricing
   =========================== */
.price {
    font-size: 2rem;
    font-weight: bold;
    color: #2d5a27;
    margin: 15px 0;
}

/* ===========================
   Dialog / Modal
   =========================== */
.dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.dialog-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.dialog-box h3 {
    color: #2d5a27;
    margin-bottom: 15px;
}

.dialog-box p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1rem;
}

/* ===========================
   Loading States
   =========================== */
.loader {
    text-align: center;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #a0aec0;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

.loader .spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
}

/* ===========================
   Tables
   =========================== */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f7fafc;
    font-weight: 600;
    font-size: 0.875rem;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===========================
   Utility Classes
   =========================== */
.divider {
    text-align: center;
    margin: 20px 0;
    color: #999;
}

.register-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.register-link a {
    color: #2d5a27;
    text-decoration: none;
    font-weight: 600;
}

#manageSection {
    display: none;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.change {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.change.positive {
    color: #48bb78;
}

.change.negative {
    color: #f56565;
}

/* ===========================
   Footer
   =========================== */
footer {
    background: #2d3748;
    color: white;
    padding: 40px 20px;
    text-align: center;
}

footer a {
    color: #4fd1c7;
    text-decoration: none;
}

/* ===========================
   Animations
   =========================== */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
