/* ========================================
   RoLeaf.ro - Domain Generator
   domenii.roleaf.ro
======================================== */

/* Google Fonts - same as main site */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Source+Sans+3:wght@400;500;600&display=swap');

/* CSS Variables - consistent with RoLeaf.ro */
:root {
    /* Primary Colors - Forest Green Palette */
    --primary-50: #f0fdf4;
    --primary-100: #dcfce7;
    --primary-200: #bbf7d0;
    --primary-300: #86efac;
    --primary-400: #4ade80;
    --primary-500: #22c55e;
    --primary-600: #16a34a;
    --primary-700: #15803d;
    --primary-800: #166534;
    --primary-900: #14532d;
    
    /* Accent - Warm Amber */
    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --accent-600: #d97706;
    
    /* Neutrals */
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    
    /* Semantic */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Source Sans 3', sans-serif;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 40px rgba(34, 197, 94, 0.15);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Container */
    --container-max: 1100px;
    --container-padding: 1.5rem;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--primary-700); }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol { list-style: none; }

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ========================================
   BUTTONS
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-800);
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--gray-500);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: color var(--transition-fast);
}

.btn-text:hover {
    color: var(--error);
}

/* ========================================
   HEADER
======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition-base);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo img {
    height: 30px;
    width: auto;
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-600);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .nav-desktop { display: none; }
    .header-cta-mobile { display: flex; }
}

@media (min-width: 769px) {
    .header-cta-mobile { display: none; }
}

/* ========================================
   HERO SECTION
======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 60px;
    background: linear-gradient(180deg, var(--primary-50) 0%, #fff 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-100);
    color: var(--primary-700);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 1.5rem;
}

.hero-badge i {
    font-size: 1rem;
}

.hero-title {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-700) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   GENERATOR CARD
======================================== */
.generator-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    margin-bottom: 2rem;
    text-align: left;
}

.generator-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-label i {
    color: var(--accent-500);
}

.form-textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    resize: vertical;
    min-height: 120px;
    transition: all var(--transition-fast);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-400);
    background: white;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.form-textarea::placeholder {
    color: var(--gray-400);
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.char-count {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-family: var(--font-display);
}

.char-count.warning {
    color: var(--warning);
    font-weight: 600;
}

/* ========================================
   LOADING STATE
======================================== */
.loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.loading-spinner {
    margin-bottom: 1.5rem;
}

.spinner-leaf {
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

.spinner-leaf img {
    width: 100%;
    height: 100%;
}

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

.loading-text {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.loading-subtext {
    font-size: 0.9375rem;
    color: var(--gray-500);
}

/* ========================================
   HERO FEATURES
======================================== */
.hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 2rem;
    margin-top: 1.5rem;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.hero-feature i {
    color: var(--primary-500);
    font-size: 1rem;
}

/* ========================================
   RESULTS SECTION
======================================== */
.results-section {
    padding: 4rem 0;
    background: var(--gray-50);
    display: none;
}

.results-section.visible {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.results-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.results-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.results-title i {
    color: var(--accent-500);
}

.results-query {
    font-size: 1rem;
    color: var(--gray-500);
    font-style: italic;
    margin-bottom: 1rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   RESULTS GRID & DOMAIN CARDS
======================================== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.domain-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 2px solid var(--gray-200);
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(20px);
}

.domain-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.domain-card:hover {
    border-color: var(--primary-200);
    box-shadow: var(--shadow-lg);
}

.domain-card.is-taken {
    opacity: 0.6;
}

.domain-card.is-taken:hover {
    opacity: 0.8;
}

.domain-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.domain-score {
    width: 52px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.domain-score.score-high {
    background: var(--primary-100);
}

.domain-score.score-high .score-value {
    color: var(--primary-600);
}

.domain-score.score-medium {
    background: #fef3c7;
}

.domain-score.score-medium .score-value {
    color: var(--accent-600);
}

.domain-score.score-low {
    background: #fee2e2;
}

.domain-score.score-low .score-value {
    color: var(--error);
}

.score-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gray-700);
    line-height: 1;
}

.score-label {
    font-size: 0.625rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.domain-name-wrapper {
    flex: 1;
    min-width: 0;
}

.domain-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    word-break: break-all;
    margin-bottom: 0.25rem;
}

.domain-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.domain-status .status-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.domain-status.available {
    color: var(--success);
}

.domain-status.available .status-spinner {
    display: none;
}

.domain-status.taken {
    color: var(--error);
}

.domain-status.taken .status-spinner {
    display: none;
}

.domain-status.error {
    color: var(--warning);
}

.domain-status.error .status-spinner {
    display: none;
}

.domain-explanation {
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.domain-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.domain-register-btn {
    flex: 1;
}

.domain-taken-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
}

/* ========================================
   RESULTS FOOTER / PROMO BOX
======================================== */
.results-footer {
    margin-top: 2rem;
}

.promo-box {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    border-radius: var(--radius-xl);
    color: white;
}

.promo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.promo-icon i {
    font-size: 1.25rem;
}

.promo-content {
    flex: 1;
}

.promo-content h4 {
    font-size: 1.125rem;
    color: white;
    margin-bottom: 0.25rem;
}

.promo-content p {
    font-size: 0.9375rem;
    opacity: 0.9;
    margin: 0;
}

.promo-code {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-weight: 700;
}

.promo-box .btn {
    background: white;
    color: var(--primary-700);
    flex-shrink: 0;
}

.promo-box .btn:hover {
    background: var(--gray-100);
    color: var(--primary-800);
}

@media (max-width: 768px) {
    .promo-box {
        flex-direction: column;
        text-align: center;
    }
    
    .promo-box .btn {
        width: 100%;
    }
}

/* ========================================
   HISTORY SECTION
======================================== */
.history-section {
    padding: 3rem 0;
    background: white;
    display: none;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.history-title {
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-title i {
    color: var(--gray-400);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: var(--gray-100);
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-query {
    font-size: 0.9375rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-domains {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.history-domain {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--primary-100);
    color: var(--primary-700);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.history-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.history-use-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-100);
    color: var(--primary-600);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.history-use-btn:hover {
    background: var(--primary-200);
    color: var(--primary-700);
}

/* ========================================
   INFO SECTION
======================================== */
.info-section {
    padding: 4rem 0;
    background: var(--gray-50);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

.info-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--gray-200);
}

.info-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-100);
    border-radius: var(--radius-lg);
    margin: 0 auto 1rem;
}

.info-icon i {
    font-size: 1.5rem;
    color: var(--primary-600);
}

.info-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.info-card p {
    font-size: 0.9375rem;
    color: var(--gray-600);
    margin: 0;
}

/* ========================================
   FOOTER
======================================== */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 3rem 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    height: 28px;
    margin: 0 auto 1rem;
    filter: brightness(0) invert(1);
}

.footer-brand p {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
    margin-bottom: 2rem;
}

.footer-links a {
    font-size: 0.9375rem;
    color: var(--gray-400);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-400);
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-800);
}

.footer-bottom p {
    font-size: 0.875rem;
    margin: 0;
}

/* ========================================
   ERROR TOAST
======================================== */
.error-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--gray-900);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    opacity: 0;
    transition: all var(--transition-base);
}

.error-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.error-toast i {
    color: var(--warning);
    font-size: 1.25rem;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 640px) {
    .hero {
        padding: 100px 0 40px;
    }
    
    .generator-card {
        padding: 1.5rem;
    }
    
    .form-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .char-count {
        text-align: center;
    }
    
    .hero-features {
        gap: 1rem;
    }
    
    .hero-feature {
        flex: 1 1 45%;
        font-size: 0.8125rem;
    }
    
    .domain-card {
        padding: 1.25rem;
    }
}
