/* Main container to hold both the sidebar and the content */
.main-container {
    display: flex;
    height: calc(100vh - 70px); /* Subtract navbar height + gap */
    width: 100%;
    margin-top: 70px; /* Add top margin for navbar + visual gap */
}

/* Navbar styles */
.navbar {
    background-color: #1E2A5E !important;
    padding: 0;
    min-height: 56px;
}

.navbar > .container-fluid {
    display: flex;
    align-items: center;
    min-height: 56px;
}

.navbar-brand {
    display: flex !important; /* Override Bootstrap's display: contents */
    align-items: center;
    padding: 0;
    margin: 0;
    line-height: 56px;
    height: 56px;
    gap: 10px;
}

.navbar-brand .brand-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.navbar-brand .brand-text {
    white-space: nowrap;
    line-height: 56px;
}

.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link {
    color: #FFD700 !important;
    font-size: 0.9rem;
    line-height: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

.navbar-dark .navbar-brand:hover,
.navbar-dark .navbar-nav .nav-link:hover {
    color: #FFFFFF !important;
}

/* Profile picture styles */
.navbar-dark .nav-item .nav-link img {
    border-radius: 50%;
    width: 30px;
    height: 30px;
    object-fit: cover;
    border: 2px solid #FFD700;
    margin-right: 8px;
}

/* User profile styles */
.user-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    height: 56px;
}

.user-profile .nav-link {
    display: flex;
    align-items: center;
}

.user-profile img {
    border-radius: 50%;
    width: 30px;
    height: 30px;
    object-fit: cover;
    border: 2px solid #FFD700;
    margin-right: 8px;
}

/* Logout icon styles */
.logout-icon {
    width: 24px;
    height: 24px;
    filter: invert(83%) sepia(71%) saturate(401%) hue-rotate(358deg) brightness(107%) contrast(107%);
}

/* Ensure vertical alignment */
.navbar-nav {
    display: flex;
    align-items: center;
    height: 56px;
}

.nav-item {
    display: flex;
    align-items: center;
    height: 56px;
}

/* Theme toggle alignment */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    padding: 0 10px;
}

/* Navbar collapse alignment */
.navbar-collapse {
    display: flex;
    align-items: center;
    height: 56px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
    }

    .navbar-collapse {
        height: auto;
    }

    .nav-item {
        height: auto;
    }

    .navbar-dark .navbar-nav .nav-link {
        height: auto;
        line-height: 1.5;
        padding: 8px 0;
    }

    .user-nav {
        margin-top: 10px;
        margin-left: 0;
        height: auto;
    }

    .theme-toggle {
        height: auto;
        padding: 8px 10px;
    }
}

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

/* If using a dark navbar, you might need to adjust the toggler border */
.navbar-toggler {
    border-color: rgba(255,255,255,0.2);
}

/* Sidebar styles */
.sidebar {
    width: 15%;
    background-color: #1E2A5E;
    color: white;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    height: 100%; /* Ensure full height */
}

/* Content area (where the cards are displayed) */
.content-area {
    width: 85%;
    padding: 20px;
    overflow-y: auto;
    height: 100%;
    background-color: #ffffff;
}

/* Styling for the sidebar items */
.sidebar-item {
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
    color: white;
}

.sidebar-item:hover {
    background-color: #2A3A7E;
}

.sidebar-item.active {
    background-color: #354AA0;
    color: white;
}

/* Card Container Styles */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    justify-content: center;
}

/* Card Styles */
.card {
    width: 100%;
    height: 400px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    transition: all 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px);
    border-color: #1E2A5E;
    border-width: 2px;
}

.card-header {
    background-color: #1E2A5E;
    color: #ffffff;
    padding: 8px 10px;
    height: 50px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.card-header h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    width: 100%;
    color: #ffffff !important;
}

.card-body {
    flex-grow: 1;
    padding: 12px 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    margin-bottom: 8px;
}
.card-footer-buttons {
    display: flex;
    gap: 10px;
}
.card-description {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 10px 5px;
    gap: 5px;
    border-top: 1px solid #e0e0e0;
}

.like-button,
.share-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    z-index: 3;
    transition: background-color 0.2s;
}
.like-button:hover,
.share-button:hover {
    background-color: #0056b3;
}

.github-icon {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 3;
}

.card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.pagination-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    margin: 0 5px;
    background-color: white;
    color: #1E2A5E;
    text-decoration: none;
    border: 1px solid #1E2A5E;
    border-radius: 50%;
    font-weight: bold;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background-color: #1E2A5E;
    color: white;
}

.pagination-btn.active {
    background-color: #1E2A5E;
    color: white;
}

.pagination-btn.disabled {
    color: #cccccc;
    border-color: #cccccc;
    cursor: not-allowed;
}

.pagination-dots {
    margin: 0 5px;
    color: #1E2A5E;
}

/* Responsive styles */
@media (max-width: 768px) {
    .sidebar {
        width: 20%;
    }
    .content-area {
        width: 80%;
    }
}

@media (max-width: 576px) {
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-footer-buttons {
        margin-top: 10px;
    }

    .share-options {
        right: auto;
        left: 0;
    }
}

/* Additional styles */
.button {
    background: linear-gradient(to right, #ff7e5f, #feb47b);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.button:hover {
    background: linear-gradient(to right, #feb47b, #ff7e5f);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Form table styles */
.form-table {
    width: 100%;
    table-layout: fixed;
}

.form-table td {
    padding: 10px;
    vertical-align: top;
}

.form-table .field-label {
    display: block;
    text-align: left;
    margin-bottom: 5px;
}

.form-table input,
.form-table textarea,
.form-table select {
    width: 100%;
    box-sizing: border-box;
}

.form-table .alert-danger {
    margin-top: 10px;
}

@media (max-width: 768px) {
    .form-table {
        width: auto;
    }
    .form-table td {
        padding: 5px;
    }
}

body {
    background-color: #ffffff;
}

.share-dropdown {
    position: relative;
    display: inline-block;
}

.share-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    z-index: 3;
}
.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #333333;
    padding: 8px;
    transition: color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    color: #555555;
    transform: scale(1.1);
}

.like-button.liked {
    color: #ff4136;
}

.save-button.saved {
    color: #1E2A5E;
}

/* GitHub icon styling */
.github-icon {
    width: 20px;
    height: 20px;
    filter: grayscale(100%);
    transition: filter 0.3s ease, transform 0.2s ease;
}

.github-icon:hover {
    filter: grayscale(0%);
    transform: scale(1.1);
}
.share-dropdown {
    display: none;
}

.share-icons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.share-icons a {
    color: #333333;
    text-decoration: none;
    font-size: 18px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.2s ease;
}

.share-icons a:hover {
    color: #555555;
    transform: scale(1.1);
}

/* WhatsApp green on hover */
.share-icons .fa-whatsapp:hover {
    color: #25D366;
}

/* Twitter blue on hover */
.share-icons .fa-twitter:hover {
    color: #1DA1F2;
}

/* Copy icon */
.share-icons .fa-copy:hover {
    color: #1E2A5E;
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}



.liked-saved-button {
    background-color: #007bff;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

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

.main-container {
    width: 100%;
    margin-top: 56px; /* Adjust based on your navbar height */
}

/* Add media query for mobile devices */
@media screen and (max-width: 768px) {
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .card-footer form,
    .card-footer a,
    .card-footer .share-dropdown {
        width: 100%;
    }

    .card-footer button,
    .card-footer a {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 8px;
        border-radius: 4px;
        background-color: #f5f5f5;
    }

    .card-footer button i,
    .card-footer a i {
        margin-right: 10px;
    }

    .card-footer .github-icon {
        height: 20px;
        margin-right: 10px;
    }

    /* Add text labels next to icons */
    .like-button::after {
        content: 'Like';
        margin-left: 8px;
    }

    .save-button::after {
        content: 'Save';
        margin-left: 8px;
    }

    .ai-chat-button::after {
        content: 'Chat';
        margin-left: 8px;
    }

    .share-button::after {
        content: 'Share';
        margin-left: 8px;
    }

    /* Adjust share options dropdown for mobile */
    .share-options {
        position: static;
        width: 100%;
        margin-top: 5px;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .share-options a {
        padding: 10px;
    }
}
