/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #0f0f23;
    --secondary-dark: #1a1a2e;
    --accent-purple: #6c5ce7;
    --accent-blue: #00cec9;
    --accent-green: #00b894;
    --accent-orange: #fd79a8;
    --text-light: #ffffff;
    --text-gray: #b2bec3;
    --text-dark: #2d3436;
    --card-bg: #16213e;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-crypto: linear-gradient(135deg, #6c5ce7 0%, #00cec9 100%);
    --gradient-success: linear-gradient(135deg, #00b894 0%, #55a3ff 100%);
    --gradient-warning: linear-gradient(135deg, #fdcb6e 0%, #fd79a8 100%);
    --gradient-danger: linear-gradient(135deg, #e17055 0%, #fd79a8 100%);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background: var(--primary-dark);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(108, 92, 231, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 206, 201, 0.1) 0%, transparent 50%);
    min-height: 100vh;
}

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

/* Header Styles */
.navbar {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(108, 92, 231, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

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

.nav-logo h1 {
    background: var(--gradient-crypto);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: var(--accent-blue);
    transform: translateY(-2px);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: var(--gradient-crypto);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Main Content */
main {
    margin-top: 80px;
}

/* Hero Section */
.hero {
    background: var(--gradient-crypto);
    color: white;
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 24px;
    font-weight: 800;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 50px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

/* Index Display */
.index-display {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.index-gauge {
    position: relative;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

/* Custom Crypto Section */
.custom-crypto-section {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    max-width: 400px;
    width: 100%;
}

.custom-crypto-section h4 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#customCryptoInput {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    background: rgba(255,255,255,0.9);
    color: #333;
    outline: none;
    transition: all 0.3s ease;
}

#customCryptoInput:focus {
    background: white;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}

#analyzeCryptoBtn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: #3498db;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#analyzeCryptoBtn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

#analyzeCryptoBtn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

.input-hint {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.input-hint p {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    margin-bottom: 5px;
    line-height: 1.4;
}

.input-hint a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.input-hint a:hover {
    text-decoration: underline;
}

.custom-result {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 20px;
    color: #333;
    animation: fadeIn 0.5s ease;
}

.custom-result .crypto-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.custom-result .crypto-icon {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 50%;
}

.custom-result .crypto-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

.custom-result .crypto-price {
    font-size: 1rem;
    color: #7f8c8d;
}

.custom-result .fear-greed-meter {
    margin: 15px 0;
}

.custom-result .recommendation {
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
    font-size: 0.9rem;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

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

.index-value {
    text-align: center;
    margin-top: 20px;
}

#indexValue {
    font-size: 3rem;
    font-weight: bold;
    display: block;
}

.index-label {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Crypto Section */
.crypto-section {
    padding: 100px 0;
    background: var(--primary-dark);
    position: relative;
}

.crypto-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(108, 92, 231, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(0, 206, 201, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.crypto-section h3 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--text-light);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.update-info {
    text-align: center;
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 60px;
    font-style: italic;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.2);
    padding: 16px 24px;
    border-radius: 30px;
    display: inline-block;
    margin-left: 50%;
    transform: translateX(-50%);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 1;
}

.crypto-card {
    background: var(--card-bg);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.crypto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-crypto);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.crypto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    border-color: rgba(108, 92, 231, 0.4);
}

.crypto-card:hover::before {
    opacity: 1;
}

.crypto-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.crypto-icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    border-radius: 50%;
}

.crypto-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 4px;
}

.crypto-price {
    font-size: 1.2rem;
    color: var(--accent-blue);
    font-weight: 600;
}

.fear-greed-meter {
    margin: 24px 0;
}

.meter-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
    position: relative;
}

.meter-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.meter-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease;
    position: relative;
    overflow: hidden;
}

.meter-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.recommendation {
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 20px;
    font-weight: 700;
    text-align: center;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.recommendation::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.recommendation:hover::before {
    left: 100%;
}

.recommendation.buy {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.3);
}

.recommendation.hold {
    background: var(--gradient-warning);
    color: white;
    box-shadow: 0 8px 25px rgba(253, 203, 110, 0.3);
}

.recommendation.sell {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 8px 25px rgba(225, 112, 85, 0.3);
}

/* Analysis Section */
.analysis-section {
    padding: 100px 0;
    background: var(--secondary-dark);
    position: relative;
}

.analysis-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 206, 201, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(108, 92, 231, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.analysis-section h3 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 60px;
    color: var(--text-light);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.recommendation-box {
    background: var(--card-bg);
    border: 1px solid rgba(0, 206, 201, 0.2);
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.recommendation-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-crypto);
}

.recommendation-box h4 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-light);
    font-weight: 700;
}

/* Education Section */
.education-section {
    padding: 100px 0;
    background: var(--primary-dark);
    position: relative;
}

.education-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 70% 30%, rgba(108, 92, 231, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 30% 70%, rgba(0, 206, 201, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.education-section h3 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 60px;
    color: var(--text-light);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.education-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    position: relative;
    z-index: 1;
}

.education-article {
    background: var(--card-bg);
    border: 1px solid rgba(108, 92, 231, 0.2);
    padding: 40px;
    border-radius: 20px;
    border-left: 4px solid var(--accent-blue);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.education-article::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.education-article:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 206, 201, 0.4);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.education-article h4 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: var(--text-light);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.education-article p {
    color: var(--text-gray);
    line-height: 1.8;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* Footer */
footer {
    background: var(--secondary-dark);
    color: var(--text-light);
    padding: 80px 0 30px;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 206, 201, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-crypto);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 50px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.footer-section h4 {
    margin-bottom: 25px;
    color: var(--text-light);
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--gradient-crypto);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section a {
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.footer-section a:hover {
    color: var(--accent-blue);
    transform: translateX(5px);
}

.footer-section p {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-bottom {
    border-top: 1px solid rgba(108, 92, 231, 0.2);
    padding-top: 30px;
    text-align: center;
    color: var(--text-gray);
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .index-display {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .custom-crypto-section {
        max-width: 100%;
    }
    
    .input-container {
        flex-direction: column;
        gap: 15px;
    }
    
    #customCryptoInput {
        width: 100%;
    }
    
    #analyzeCryptoBtn {
        width: 100%;
        padding: 15px;
    }
    
    .crypto-grid {
        grid-template-columns: 1fr;
    }
    
    .education-content {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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