/* styles/token-details.css */

body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    margin: 0;
    padding: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    padding: 2em;
    background-color: #121212;
    color: #fff;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.token-title {
    color: #ff9d00;
    text-align: center;
    margin-bottom: 1em;
    font-family: 'Comic Neue', cursive;
    font-size: 1.8em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Grid Layout for Desktop (Screen Width > 1024px) */
.token-content {
    display: grid;
    grid-template-columns: 3fr 1fr; /* 75% chart, 25% trade */
    gap: 2em; /* Consistent spacing for desktop */
    margin-bottom: 2em;
}

.chart-section {
    grid-column: 1 / 2; /* Full width of first column */
}

.trade-section {
    grid-column: 2 / 3; /* Full width of second column */
    background-color: #1a1a1a;
    padding: 1.5em;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    max-width: 400px; /* Match SherPepe trade panel width */
}

.stats-section {
    grid-column: 1 / 3; /* Span both columns, centered below */
    background-color: #1a1a1a;
    padding: 1.5em;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    margin: 2em auto 0;
    justify-self: center; /* Center horizontally in grid */
}

.token-description-section {
    grid-column: 1 / 3; /* Span both columns, centered below stats */
    background-color: #1a1a1a;
    padding: 1.5em;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    margin: 2em auto 0;
    justify-self: center; /* Center horizontally in grid */
}

.activity-section {
    grid-column: 1 / 3; /* Span both columns, centered below description */
    margin-top: 2em;
    background-color: #1a1a1a;
    padding: 1.5em;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    max-width: 1400px;
    margin: 0 auto;
    justify-self: center; /* Center horizontally in grid */
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em;
    padding: 0.5em;
    background-color: #1a1a1a;
    border-radius: 4px 4px 0 0;
}

.chart-title {
    font-family: 'Comic Neue', cursive;
    color: #ff9d00;
    font-size: 1.1em;
    margin: 0;
}

.chart-options {
    display: flex;
    gap: 0.5em;
}

#tradingview-chart {
    margin-bottom: 10px;
}

#token-price {
    color: #fff;
    font-weight: bold;
    font-size: 0.9em;
}

#timeframe {
    padding: 0.5em;
    border: 1px solid #541767;
    border-radius: 4px;
    background-color: #1a1a1a;
    color: #fff;
    font-size: 0.9em;
}

.trade-section h3 {
    color: #ff9d00;
    text-align: center;
    margin-bottom: 0.5em;
    font-family: 'Comic Neue', cursive;
    font-size: 1.2em;
}

.trade-balances {
    text-align: center;
    color: #fff;
    font-size: 0.9em;
    margin-bottom: 1em;
    font-weight: bold;
}

.trade-balances p {
    margin: 0.3em 0;
}

#trade-form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.trade-direction {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

.trade-field {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.trade-field select, .trade-field input {
    width: 100%;
    padding: 0.8em;
    margin-top: 0.3em;
    border: 1px solid #541767;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    background-color: #121212;
    color: #fff;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23ff9d00" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.3s ease;
}

.trade-field select:focus, .trade-field input:focus {
    border-color: #ff9d00;
    outline: none;
    box-shadow: 0 0 5px rgba(255, 157, 0, 0.3);
}

.trade-field input[readonly] {
    background-color: #1a1a1a;
    cursor: not-allowed;
}

.trade-toggle {
    background-color: #541767;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0.5em auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trade-toggle:hover {
    background-color: #431257;
    transform: scale(1.1);
}

.trade-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5em;
}

.trade-options label {
    color: #fff;
    font-size: 0.9em;
}

#slippage {
    width: 60px;
    padding: 0.5em;
    border: 1px solid #541767;
    border-radius: 4px;
    background-color: #121212;
    color: #fff;
    font-size: 0.9em;
}

.quick-amounts {
    display: flex;
    gap: 0.5em;
}

.quick-amount {
    padding: 0.5em 0.8em;
    background-color: #1a1a1a;
    color: #fff;
    border: 1px solid #541767;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.quick-amount:hover {
    background-color: #022253;
}

.trade-actions {
    display: flex;
    gap: 1em;
    margin-top: 1em;
}

.trade-action {
    flex: 1;
    padding: 0.8em 1.5em;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-family: 'Comic Neue', cursive;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.trade-action.buy {
    background-color: #00ff7f;
    color: #121212;
}

.trade-action.sell {
    background-color: #ff4d4d;
    color: #fff;
}

.trade-action:hover {
    transform: translateY(-2px);
}

#trade-message {
    margin-top: 1em;
    font-weight: bold;
    text-align: center;
    padding: 0.5em;
    border-radius: 4px;
    color: #fff;
}

.stats-section h3, .token-description-section h3 {
    color: #ff9d00;
    font-family: 'Comic Neue', cursive;
    font-size: 1.2em;
    margin-bottom: 0.5em;
}

.token-stats p {
    margin: 0.3em 0;
    font-size: 0.9em;
    color: #fff;
    text-align: left;
}

.token-description p {
    margin: 0.3em 0;
    font-size: 0.9em;
    color: #fff;
    text-align: left;
}

.activity-section h3 {
    color: #ff9d00;
    font-family: 'Comic Neue', cursive;
    font-size: 1.2em;
    margin-bottom: 1em;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #121212;
    font-size: 0.9em;
}

.activity-table th, .activity-table td {
    padding: 0.8em;
    text-align: left;
    border-bottom: 1px solid #2d2d2d;
}

.activity-table th {
    background-color: #1a1a1a;
    color: #fff;
    font-weight: bold;
}

.activity-table tr:hover {
    background-color: #2d2d2d;
    cursor: pointer;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #121212;
    font-size: 0.9em;
}

.order-table th, .order-table td {
    padding: 0.8em;
    text-align: center;
    border-bottom: 1px solid #2d2d2d;
}

.order-table th {
    background-color: #541767;
    color: #fff;
    font-weight: bold;
}

.order-table tr:hover {
    background-color: #2d2d2d;
}

/* Responsive Adjustments (Switch to Flexbox for Mobile < 1024px) */
@media (max-width: 1024px) {
    .token-content {
        display: flex;
        flex-direction: column;
    }

    .chart-section {
        max-width: 100%;
    }

    .trade-section {
        max-width: 100%;
        margin-top: 1em;
    }

    .stats-section, .token-description-section, .activity-section {
        max-width: 100%;
        margin-top: 1em;
    }
}

@media (max-width: 768px) {
    main {
        padding: 1em;
    }

    .token-title {
        font-size: 1.6em;
    }

    .chart-section, .trade-section, .stats-section, .token-description-section, .activity-section {
        padding: 1em;
    }

    .trade-field select, .trade-field input {
        padding: 0.6em;
    }

    .trade-action {
        padding: 0.6em 1.2em;
        font-size: 0.9em;
    }

    #slippage, .quick-amount {
        font-size: 0.8em;
    }

    .activity-table th, .activity-table td {
        padding: 0.6em;
        font-size: 0.8em;
    }
}

@media (max-width: 600px) {
    .token-title {
        font-size: 1.4em;
    }

    .trade-direction, .trade-options, .trade-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.5em;
    }

    .trade-actions {
        margin-top: 0.5em;
    }

    .quick-amounts {
        flex-wrap: wrap;
    }

    .activity-table {
        font-size: 0.7em;
    }

    .activity-table th, .activity-table td {
        padding: 0.5em;
    }
}

footer {
    background: linear-gradient(90deg, #541767 0%, #022253 100%);
    color: #fff;
    text-align: center;
    padding: 1em 0;
    width: 100%;
}

.footer-links {
    margin-top: 0.5em;
}

.footer-links a {
    color: #ff9d00;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #e68c00;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.5em;
    }
}

.order-book {
    margin-top: 1em;
    background-color: #1a1a1a;
    padding: 1em;
    border-radius: 8px;
    margin-bottom: 10px;
}

.order-book h3 {
    color: #ff9d00;
    font-family: 'Comic Neue', cursive;
    margin-bottom: 0.5em;
}