/* Tool Hero Section - Required by tool-page-structure.mdc */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }
}

/* Fibonacci Tool Styles */
.fibonacci-tool-wrapper {
    margin: 0 auto;
}

.fib-tool-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 32px;
    margin-bottom: 32px;
}

.fib-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.fib-control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fib-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fib-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.fib-input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    background: #ffffff;
    transition: all 0.2s ease;
    outline: none;
}

.fib-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.fib-input::placeholder {
    color: #9ca3af;
}

.fib-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    outline: none;
    position: relative;
}

.fib-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.fib-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.fib-btn-primary:active {
    transform: translateY(0);
}

.fib-btn-secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.fib-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.fib-btn-secondary:active {
    transform: translateY(0);
}

.fib-btn-copy {
    background: #f3f4f6;
    color: #374151;
    padding: 10px 20px;
    font-size: 14px;
}

.fib-btn-copy:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fib-nth-result {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fib-nth-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.fib-nth-label {
    font-size: 16px;
    font-weight: 600;
    color: #0369a1;
}

.fib-nth-value {
    font-size: 28px;
    font-weight: 700;
    color: #0c4a6e;
    
}

.fib-results {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fib-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.fib-results-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.fib-sequence-display {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
    min-height: 100px;
    max-height: 500px;
    overflow-y: auto;
}

.fib-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    animation: numberAppear 0.3s ease;
    cursor: default;
}

@keyframes numberAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fib-number:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.fib-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    border: 2px solid #fbbf24;
}

.fib-stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fib-stat-label {
    font-size: 13px;
    font-weight: 600;
    color: #78350f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fib-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #92400e;
    
}

.copy-icon {
    font-size: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .fib-tool-card {
        padding: 24px 20px;
    }

    .fib-controls {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .fib-input-wrapper {
        flex-direction: column;
    }

    .fib-btn {
        width: 100%;
    }

    .fib-results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .fib-btn-copy {
        width: 100%;
    }

    .fib-sequence-display {
        padding: 16px;
        max-height: 400px;
    }

    .fib-number {
        padding: 8px 12px;
        font-size: 14px;
    }

    .fib-stats {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .fib-nth-value {
        font-size: 24px;
    }

    .fib-results-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .fib-tool-card {
        padding: 20px 16px;
    }

    .fib-sequence-display {
        padding: 12px;
        gap: 8px;
    }

    .fib-number {
        padding: 6px 10px;
        font-size: 13px;
    }

    .fib-stat-value {
        font-size: 20px;
    }
}

/* Scrollbar Styling */
.fib-sequence-display::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.fib-sequence-display::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.fib-sequence-display::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.fib-sequence-display::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
