/* Base Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f5f5f5;
    padding-top: 50px;
}

/* Header and Navigation */
.header {
    background-color: #333;
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 50px;
}

.header .logo {
    font-size: 16px;
    font-weight: bold;
    margin-right: 30px;
    margin-left: 20px;
    padding-left: 10px;
}

.nav-links {
    list-style: none;
    display: none;
    flex-direction: column;
    position: fixed;
    top: 50px;
    left: 0;
    width: 100%;
    background-color: #333;
    padding: 10px 0;
    margin: 0;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.nav-links.active {
    display: flex;
}

.nav-links li {
    margin: 5px 0;
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 15px;
    width: 100%;
    max-width: 200px;
    text-align: center;
    transition: 0.3s;
}

.nav-links a:hover {
    background-color: #555;
    border-radius: 5px;
}

/* Hamburger Menu */
.hamburger {
    display: block;
    cursor: pointer;
    margin-right: 20px;
    padding: 3px;
    position: absolute;
    right: 15px;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: white;
    margin: 4px 0;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Container and Layout */
.container {
    width: 100%;
    max-width: 800px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: 60px;
}

/* Form Elements */
input[type="text"],
input[type="date"] {
    padding: 0.5rem;
    width: 220px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    max-width: 150px;
}

button:hover {
    background-color: #0056b3;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
    cursor: pointer;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Pivot Points Specific */
.pivot-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

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

.level {
    padding: 10px;
    border-radius: 4px;
    background: #f8f9fa;
}

.level strong {
    display: block;
    margin-bottom: 5px;
}

.level span {
    font-size: 1.1em;
    font-weight: bold;
}

.resistance { color: #dc3545; }
.support { color: #28a745; }
.pivot { color: #007bff; }

/* Status Messages */
.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

.error-message {
    color: #dc3545;
    margin: 10px 0;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
    display: none;
}

/* Chart Containers */
.chart-container {
    width: 100%;
    height: 500px;
    margin: 20px 0;
}

#tradingview-widget-container {
    width: 100%;
    height: 600px;
    margin-top: 20px;
}

/* Divergence Table Specific */
.divergence-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.divergence-table th, 
.divergence-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.divergence-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    cursor: pointer;
}

/* Divergence Type Colors */
.bullish { color: #28a745; }
.bearish { color: #dc3545; }

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        display: flex;
        justify-content: space-between;
        text-align: center;
        padding: 10px;
        height: auto;
        min-height: 30px;
    }

    .hamburger {
        display: block;
        position: absolute;
        right: 20px;
    }

    .nav-links {
        position: fixed;
        top: 70px;
    }

    .container {
        width: 95%;
        margin: 60px auto 20px;
    }

    input,
    button {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .header .logo {
        font-size: 14px;
        margin-left: 15px;
        padding-left: 5px;
    }

    .container {
        padding: 10px;
    }

    .logo {
        margin-left: 10px;
    }

    input,
    button {
        font-size: 14px;
    }
}

/* Responsive table styles */
@media screen and (max-width: 768px) {
    #cryptoTable th:nth-child(3), /* Volume column */
    #cryptoTable td:nth-child(3),
    #cryptoTable th:nth-child(6), /* BB Width column */
    #cryptoTable td:nth-child(6) {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    #cryptoTable th:nth-child(5), /* RSI column */
    #cryptoTable td:nth-child(5) {
        display: none;
    }
}

/* Logo link styles */
.logo {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.8;
}
