/* Global Styles */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --dark: #111827;
    --light: #f9fafb;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: var(--dark);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark);
}

/* Navbar Styles */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

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

.logout-btn {
    background-color: var(--gray-light);
    color: var(--dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background-color: var(--danger);
    color: white;
    text-decoration: none;
}

/* Login/Register Page */
.login-page {
    background: linear-gradient(135deg, #0e2a47 0%, #1e3c72 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
}

.login-header {
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
}

.site-title {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    color: white;
}

.site-slogan {
    font-size: 0.9rem;
    opacity: 0.9;
}

.tabs {
    position: relative;
}

.tab-header {
    display: flex;
    border-bottom: 1px solid var(--gray-light);
}

.tab {
    padding: 1rem;
    width: 50%;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab.active {
    border-bottom: 3px solid var(--primary);
    color: var(--primary);
}

.tab-content {
    padding: 1.5rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background-color: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.auth-btn:hover {
    background-color: var(--primary-dark);
}

.features {
    padding: 1.5rem;
    background-color: rgba(37, 99, 235, 0.05);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    text-align: center;
}

.feature {
    flex: 1;
    min-width: 33%;
    padding: 1rem;
}

.feature i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.feature h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.feature p {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Dashboard Styles */
.dashboard-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 60px);
    /* Adjust for navbar height */
    background-color: #f0f2f5;
}

.sidebar {
    background-color: white;
    padding: 1.5rem;
    border-right: 1px solid var(--gray-light);
}

.user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.admin-avatar {
    background-color: var(--dark);
}

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

.badge {
    font-size: 0.8rem;
    background-color: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    margin-top: 0.5rem;
}

.summary-card {
    background-color: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.summary-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profit,
.loss,
.net {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.profit i {
    color: var(--success);
}

.loss i {
    color: var(--danger);
}

.positive {
    color: var(--success);
}

.negative {
    color: var(--danger);
}

.main-content {
    padding: 2rem;
}

.main-content h2 {
    margin-bottom: 1.5rem;
}

.signals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 1.5rem;
}

.signal-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.signal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.signal-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Admin Panel Styles */
.admin-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 60px);
}

.stats-box {
    background-color: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 1.5rem;
}

.stats-box h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}

.admin-card {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.admin-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-form .form-group {
    margin-bottom: 1.25rem;
}

.admin-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

.admin-form textarea {
    min-height: 150px;
    resize: vertical;
}

.admin-form select:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.primary-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-item {
    background-color: white;
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    overflow: hidden;
}

.post-meta {
    padding: 1rem;
    background-color: #f9fafb;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-light);
}

.post-type,
.post-date {
    font-size: 0.85rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-content {
    padding: 1.5rem;
    overflow: hidden;
}

.preview-img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.post-actions {
    padding: 1rem;
    border-top: 1px solid var(--gray-light);
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background-color: transparent;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.edit-btn:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.delete-btn:hover {
    background-color: var(--danger);
    border-color: var(--danger);
    color: white;
}

.edit-container {
    padding: 1rem;
    border-top: 1px solid var(--gray-light);
    display: none;
}

.edit-container:not(:empty) {
    display: block;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Error Messages */
.error {
    color: var(--danger);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* No posts message */
.no-signals {
    grid-column: span 2;
    text-align: center;
    padding: 2rem;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    background-color: white;
    border-top: 1px solid var(--gray-light);
    color: var(--gray);
    font-size: 0.85rem;
}

/* Trade Card Styling (Enhanced Version) */
.trade-card {
    width: 100%;
    padding: 1.5rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
    text-align: center;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.trade-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.18);
}

.trade-pair {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
    color: var(--dark);
}

.trade-action {
    display: inline-block;
    padding: 0.4rem 1.25rem;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.trade-action.buy {
    background-color: var(--success);
    color: white;
}

.trade-action.sell {
    background-color: var(--danger);
    color: white;
}

.target-price {
    margin: 1rem 0;
    font-size: 1rem;
    color: var(--gray);
    font-weight: 500;
}

.target-hit {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
    margin: 0.75rem 0;
    letter-spacing: 0.5px;
}

.trade-profit {
    margin-top: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success);
    display: inline-block;
    padding: 0.3rem 1rem;
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: 100px;
}

.trade-loss {
    margin-top: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--danger);
    display: inline-block;
    padding: 0.3rem 1rem;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 100px;
}

/* Responsive Design */
@media (max-width: 992px) {

    .dashboard-container,
    .admin-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--gray-light);
        padding-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .signals-grid {
        grid-template-columns: 1fr;
    }

    .no-signals {
        grid-column: span 1;
    }

    .login-container {
        width: 100%;
    }

    .features {
        flex-direction: column;
    }

    .feature {
        min-width: 100%;
        margin-bottom: 1rem;
    }
}

/* Mobile viewport styles - FIXED to show logout button */
@media (max-width: 576px) {
    .navbar {
        padding: 0.75rem 1rem;
    }

    /* Keep nav-links visible */
    .nav-links {
        display: flex;
    }

    /* Make logout button smaller on mobile */
    .logout-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    /* Adjust other responsive elements */
    .main-content {
        padding: 1rem;
    }

    .login-header {
        padding: 1.5rem;
    }

    .tab-content {
        padding: 1rem;
    }
}

/* Updated CSS for trade-action styles */
.trade-action.buy {
    background-color: var(--primary);
    color: white;
}

.trade-action.sell {
    background-color: var(--danger);
    color: white;
}

/* These are existing styles in your CSS, just ensure they are properly set */
.signals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 1.5rem;
}

/* Make sure trade cards take full height in grid cells */
.signal-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
}

.signal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Update the trade card to take full width and height */
.trade-card {
    width: 100%;
    padding: 1.5rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
    text-align: center;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}