* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0d1117;
    min-height: 100vh;
    color: #c9d1d9;
}

/* Navbar */
.navbar {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.navbar-content {
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, #58a6ff 0%, #bc8cff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

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

.nav-links a {
    color: #8b949e;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: #58a6ff;
}

/* Container */
.container {
    padding: 20px 40px;
}

/* Header */
.header {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    margin-top: 30px;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #58a6ff 0%, #bc8cff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.header p {
    color: #8b949e;
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #58a6ff;
}

.stat-card h3 {
    color: #8b949e;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #c9d1d9;
}

/* Search Bar */
.search-bar {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 15px 25px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 12px 16px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #c9d1d9;
    transition: border-color 0.2s ease;
}

.search-bar input:focus {
    border-color: #58a6ff;
}

.search-bar input::placeholder {
    color: #6e7681;
}

/* Table */
.table-container {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 30px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, #1f6feb 0%, #8957e5 100%);
}

thead th {
    color: white;
    padding: 20px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

thead th:first-child {
    border-radius: 10px 0 0 0;
}

thead th:last-child {
    border-radius: 0 10px 0 0;
}

tbody tr {
    border-bottom: 1px solid #21262d;
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #0d1117;
}

tbody td {
    padding: 20px 15px;
    color: #c9d1d9;
}

.rank {
    font-weight: bold;
    color: #6e7681;
}

.coin-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coin-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.coin-name {
    font-weight: 600;
    color: #c9d1d9;
}

.coin-symbol {
    color: #8b949e;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.price {
    font-weight: 600;
    font-size: 1.1rem;
}

.positive {
    color: #3fb950;
}

.negative {
    color: #f85149;
}

/* Buttons */
.chart-btn {
    background: linear-gradient(135deg, #1f6feb 0%, #8957e5 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.chart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 111, 235, 0.4);
}

.refresh-btn {
    background: linear-gradient(135deg, #1f6feb 0%, #8957e5 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 111, 235, 0.4);
}

/* Coin Detail Page */
.breadcrumb {
    margin: 30px 0 20px 0;
}

.breadcrumb a {
    color: #58a6ff;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #79c0ff;
}

.coin-header {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.coin-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.coin-icon-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.coin-header h1 {
    font-size: 2.5rem;
    color: #c9d1d9;
    margin-bottom: 8px;
}

.coin-symbol-large {
    color: #8b949e;
    font-size: 1.5rem;
    font-weight: normal;
    text-transform: uppercase;
}

.coin-rank {
    color: #8b949e;
    font-size: 0.95rem;
    background: #0d1117;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
}

.coin-price-header {
    text-align: right;
}

.price-large {
    font-size: 3rem;
    font-weight: bold;
    color: #c9d1d9;
    margin-bottom: 8px;
}

.price-change-large {
    font-size: 1.3rem;
    font-weight: 600;
}

/* Coin Details Grid */
.coin-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.detail-card:hover {
    transform: translateY(-2px);
    border-color: #58a6ff;
}

.detail-card h4 {
    color: #8b949e;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-card .detail-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #c9d1d9;
}

/* Chart Section */
.chart-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.chart-section h2 {
    color: #c9d1d9;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.tradingview-widget-container {
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
}

#tradingview_chart {
    height: 100%;
    width: 100%;
}

/* About Section */
.about-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.about-section h2 {
    color: #c9d1d9;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.about-content {
    color: #8b949e;
    line-height: 1.8;
    font-size: 1rem;
}

/* Links Section */
.links-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.links-section h2 {
    color: #c9d1d9;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.link-btn {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    font-weight: 500;
}

.link-btn:hover {
    background: #21262d;
    border-color: #58a6ff;
    color: #58a6ff;
    transform: translateY(-2px);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px;
    color: #8b949e;
    font-size: 1.3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-content {
        padding: 15px 20px;
    }

    .logo {
        font-size: 1.4rem;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .container {
        padding: 15px 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .coin-header {
        padding: 25px;
    }

    .coin-header h1 {
        font-size: 1.8rem;
    }

    .price-large {
        font-size: 2rem;
    }

    .price-change-large {
        font-size: 1rem;
    }

    table {
        font-size: 0.9rem;
    }

    thead th, tbody td {
        padding: 15px 10px;
    }

    .tradingview-widget-container {
        height: 400px;
    }
}
