/* ===== Dark Theme Global Styles ===== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --bg-dark: #0f0f0f;
    --bg-darker: #000000;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #2a2a2a;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

html {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-dark);
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

/* ===== Navbar ===== */
.navbar {
    padding: 1.5rem 0;
    background-color: var(--bg-darker) !important;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand img {
    height: 40px;
    width: 40px;
    border-radius: 8px;
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
    opacity: 0.9;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary) !important;
}

/* ===== Main Content ===== */
main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* ===== Hero Section ===== */
.hero-section {
    padding: 120px 0 80px;
    background: var(--bg-darker);
    flex: 1 0 auto;
    display: flex;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #e8e8e8;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.hero-features {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.hero-features li {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    line-height: 1.6;
}

.hero-features li i {
    color: var(--text-secondary);
    font-size: 1.2rem;
    width: 24px;
    flex-shrink: 0;
}

.hero-features li span {
    flex: 1;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-outline-light {
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    background: transparent;
}

.btn-outline-light:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

/* ===== Legal Pages ===== */
.legal-header {
    background: var(--bg-darker);
    padding: 100px 0 60px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.legal-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #e8e8e8;
}

.legal-header .last-updated {
    font-size: 1rem;
    color: var(--text-secondary);
}

.legal-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

.legal-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.legal-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.legal-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.legal-content ul,
.legal-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.legal-content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.legal-content strong {
    color: var(--text-primary);
}

/* ===== Crypto Ticker ===== */
.ticker-wrapper {
    width: 100%;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    padding: 16px 0;
    min-height: 60px;
    background: rgba(255, 255, 255, 0.02);
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    flex-shrink: 0;
    margin-top: auto;
}

.footer h5,
.footer h6 {
    color: var(--text-primary);
}

.footer p {
    color: var(--text-secondary);
}

.footer a {
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

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

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ===== iPhone Mockup ===== */
.iphoneFront {
    width: 294px;
    height: 600px;
    background-color: #000;
    border-radius: 50px;
    position: relative;
    pointer-events: none;
}

.iphoneFront .frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid #bbb5b3;
    border-radius: 50px;
    box-shadow: 0 0 0 1px #4a4947;
}

.iphoneFront .antenas>div {
    background-color: #75726f;
    position: absolute;
}

.iphoneFront .antenas .tt {
    width: 8px;
    height: 3.5px;
    top: 0;
    right: 60px;
}

.iphoneFront .antenas .tr {
    width: 3.5px;
    height: 8px;
    top: 60px;
    right: -1px;
}

.iphoneFront .antenas .tl {
    width: 3.5px;
    height: 8px;
    top: 60px;
    left: -1px;
}

.iphoneFront .antenas .bb {
    width: 8px;
    height: 3.5px;
    bottom: -1.5px;
    left: 60px;
}

.iphoneFront .antenas .bl {
    width: 3.5px;
    height: 8px;
    bottom: 60px;
    left: -1px;
}

.iphoneFront .antenas .br {
    width: 3.5px;
    height: 8px;
    bottom: 60px;
    right: -1px;
}

.iphoneFront .keys .silent {
    width: 3.5px;
    height: 28px;
    border-top: 2px solid #eae0d9;
    border-bottom: 2px solid #eae0d9;
    position: absolute;
    top: 105px;
    left: -4.5px;
    background: linear-gradient(90deg, #888, #555);
}

.iphoneFront .keys .volt {
    width: 3.5px;
    height: 50px;
    border-top: 2px solid #eae0d9;
    border-bottom: 2px solid #eae0d9;
    position: absolute;
    top: 150px;
    left: -4.5px;
    background: linear-gradient(90deg, #888, #555);
}

.iphoneFront .keys .volb {
    width: 3.5px;
    height: 50px;
    border-top: 2px solid #eae0d9;
    border-bottom: 2px solid #eae0d9;
    position: absolute;
    top: 210px;
    left: -4.5px;
    background: linear-gradient(90deg, #888, #555);
}

.iphoneFront .keys .lock {
    width: 3.5px;
    height: 70px;
    border-top: 2px solid #eae0d9;
    border-bottom: 2px solid #eae0d9;
    position: absolute;
    top: 192px;
    right: -4.5px;
    background: linear-gradient(-90deg, #888, #555);
}

.iphoneFront .screen {
    width: 270px;
    height: 576px;
    background: #000;
    border-radius: 40px;
    margin-top: 12px;
    margin-left: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.iphoneFront .island {
    position: absolute;
    top: 8px;
    right: 0;
    left: 0;
    margin-right: auto;
    margin-left: auto;
    width: 90px;
    height: 25px;
    background-color: #000;
    border-radius: 40px;
    z-index: 10;
}

.iphoneFront .island .camera {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
    width: 15px;
    height: 15px;
    background-color: #111;
    border-radius: 50%;
}

.iphoneFront .island .camera::before {
    content: '';
    display: block;
    position: absolute;
    top: 3px;
    left: 3px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #161a3c;
}

.iphoneFront .island .camera::after {
    content: '';
    display: block;
    position: absolute;
    top: 5px;
    left: 5px;
    width: 5px;
    height: 5px;
    background: linear-gradient(0deg, #03344f 0%, #040e27 50%, #3e5191 100%);
    border-radius: 50%;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    height: 44px;
}

.status-icons {
    display: flex;
    gap: 6px;
    font-size: 10px;
}

/* App Header */
.app-header {
    padding: 8px 20px 16px;
    background: #000;
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.5px;
}

/* News List */
.news-list {
    flex: 1;
    overflow-y: auto;
    background: #000;
}

.news-list::-webkit-scrollbar {
    display: none;
}

.news-item {
    margin: 0 16px 8px 16px;
    padding: 10px;
    background: #1c1c1e;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.news-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-title.main-story {
    font-size: 14px;
}

.news-summary {
    font-size: 11px;
    color: #8e8e93;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* When summary is in a row with an image, show 4 lines */
.news-summary-row .news-summary {
    -webkit-line-clamp: 4;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.news-source-tag {
    color: #ff3b30;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-time-tag {
    color: #8e8e93;
    font-size: 8px;
}

.news-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-summary-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.news-text {
    flex: 1;
    min-width: 0;
}

.news-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.news-footer {
    display: flex;
    align-items: center;
    margin-top: 4px;
}

/* Blur Effect for Items 4+ */
.news-item.blurred {
    filter: blur(5px);
    opacity: 0.5;
}

.news-list {
    padding-top: 8px;
}

/* AI Analysis */
.ai-analysis {
    margin: 8px 0 12px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.ai-icon {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 10px;
    color: #bf5af2;
}

.ai-analysis-text {
    font-size: 10px;
    color: #bf5af2;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Crypto Impact Badges */
.crypto-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.crypto-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    flex-shrink: 0;
}

.crypto-logo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    background: #3a3a3c;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.crypto-code {
    color: #fff;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
}

.crypto-score {
    min-width: 18px;
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    color: #000;
    margin-left: -2px;
}

/* iOS color scheme: Red (8-10), Orange (5-7), Green/Yellow (1-4) */
.crypto-score.high {
    background: #ff3b30;
    color: #fff;
}

.crypto-score.medium {
    background: #ff9500;
    color: #fff;
}

.crypto-score.low {
    background: #ffd60a;
    color: #000;
}

/* Loading Spinner */
.news-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Home Indicator */
.home-indicator {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.home-indicator::before {
    content: '';
    width: 140px;
    height: 5px;
    background: #fff;
    border-radius: 3px;
    opacity: 0.3;
}

/* Responsive */
@media (max-width: 991px) {
    .iphoneFront {
        margin-top: 40px;
        width: 260px;
        height: 530px;
    }

    .iphoneFront .screen {
        width: 238px;
        height: 508px;
    }

    .iphoneFront .island {
        width: 80px;
        height: 22px;
    }

    .iphoneFront .island .camera {
        width: 13px;
        height: 13px;
    }

    .status-bar {
        padding: 10px 16px 6px;
        font-size: 11px;
    }

    .app-title {
        font-size: 24px;
    }

    .news-item {
        margin: 0 10px 8px 10px;
        padding: 16px;
    }

    .news-title {
        font-size: 14px;
    }

    .news-title.main-story {
        font-size: 16px;
    }

    .news-summary {
        font-size: 12px;
    }
}

/* ===== Crypto Ticker ===== */
.ticker-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 16px 0;
    min-height: 60px;
    display: block;
    background-color: black;
}

.ticker-container {
    width: 100%;
    overflow: hidden;
}

.ticker-content {
    display: inline-flex;
    gap: 3rem;
    animation: scroll-left 30s linear infinite;
    will-change: transform;
    white-space: nowrap;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ticker-content:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    padding: 0.25rem 0;
}

.ticker-logo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.ticker-symbol {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.ticker-price {
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.ticker-price.positive {
    color: #10b981;
}

.ticker-price.negative {
    color: #ef4444;
}

.ticker-change {
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.ticker-change.positive {
    color: #10b981;
}

.ticker-change.negative {
    color: #ef4444;
}

@media (max-width: 768px) {
    .hero-section .row {
        flex-direction: column-reverse;
    }

    .iphoneFront {
        margin-top: 0;
        margin-bottom: 30px;
    }
}