/* General Styles */
body {
    min-height: 100vh;
    background-color: #f5f5f5;
    color: #333;
}

/* Header */
header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: #1a1a1a;
    border-bottom: 1px solid #333;
}

.main-nav .nav-link {
    padding: 10px 15px;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
    color: #007bff !important;
}

/* Submenu */
.submenu {
    position: fixed;
    top: 70px; /* Adjust based on header height */
    width: 100%;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    z-index: 999;
}

.submenu .nav-link {
    padding: 10px 15px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.submenu .nav-link:hover,
.submenu .nav-link.active {
    color: #000;
    border-bottom: 2px solid #000;
}

/* Main Content */
.content {
    margin-top: 120px; /* Adjust based on header + submenu height */
    padding: 20px; /* Default padding for desktop */
}

.card {
    background-color: #fff;
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
}

.list-group-item {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1rem; /* Default padding for desktop */
}

.form-control,
.form-select {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.form-control:focus,
.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    border-radius: 5px;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 5px;
}

.table {
    background-color: #fff;
}

.table th,
.table td {
    border-color: #ddd;
}

.plan-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.plan-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.plan-card.border-primary {
    border: 2px solid #007bff !important;
}

/* Bot-specific styles (default for desktop) */
.bot-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping if too many buttons */
}

.list-group-item > span {
    word-break: break-word;
    max-width: 50%; /* Prevent overlap with buttons on desktop */
}

/* Mobile-specific adjustments */
@media (max-width: 767.98px) {
    .content {
        padding: 0.5rem; /* Reduced padding on mobile */
    }

    .list-group-item {
        flex-direction: column; /* Stack content vertically */
        align-items: stretch; /* Full width for children */
        padding: 0.75rem; /* Slightly less padding on mobile */
    }

    .bot-actions {
        flex-direction: column; /* Stack buttons vertically */
        width: 100%; /* Full width on mobile */
        margin-top: 0.5rem; /* Space from bot info */
    }

    .btn-sm {
        width: 100%; /* Full-width buttons */
        margin: 0.25rem 0; /* Vertical spacing between buttons */
        padding: 0.5rem 1rem; /* Larger padding for touch targets */
        font-size: 0.9rem; /* Slightly larger text */
        min-height: 48px; /* Minimum touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Override horizontal margin on mobile */
    .btn-sm.me-2 {
        margin-right: 0;
    }
}

/* Desktop-specific adjustments (optional reinforcement) */
@media (min-width: 768px) {
    .bot-actions {
        flex-direction: row; /* Ensure horizontal layout */
        width: auto; /* Reset width */
    }

    .btn-sm {
        width: auto; /* Default width */
        margin-right: 0.5rem; /* Restore horizontal spacing */
        margin-bottom: 0; /* No vertical spacing */
        padding: 0.25rem 0.5rem; /* Bootstrap default btn-sm padding */
        font-size: 0.875rem; /* Bootstrap default btn-sm font size */
        min-height: auto; /* Reset to default */
    }

    .btn-sm:last-child {
        margin-right: 0; /* Remove margin from last button */
    }
}
/* Mobile Dropdown Menu Styles */
@media (max-width: 767.98px) {
    .submenu {
        padding: 0.5rem 1rem; /* Adjust padding for mobile */
    }

    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.75rem;
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.55)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

    .navbar-collapse {
        background-color: #fff;
        border-radius: 5px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        margin-top: 0.5rem;
    }

    .navbar-nav {
        padding: 0.5rem 0;
    }

    .submenu .nav-item {
        width: 100%;
    }

    .submenu .nav-link {
        padding: 0.75rem 1rem;
        color: #333;
        border-bottom: none; /* Remove bottom border for dropdown */
        text-align: left;
    }

    .submenu .nav-link:hover,
    .submenu .nav-link.active {
        background-color: #f5f5f5;
        color: #007bff;
        border-bottom: none;
    }
}

/* Ensure desktop styles remain intact */
@media (min-width: 768px) {
    .navbar-toggler {
        display: none; /* Hide toggle button on desktop */
    }

    .navbar-collapse {
        display: flex !important; /* Force display on desktop */
    }

    .navbar-nav {
        flex-direction: row; /* Horizontal layout on desktop */
    }

    .submenu .nav-link {
        padding: 10px 15px; /* Restore desktop padding */
    }
}
