/* Custom styles for Digital Products Platform */

/* General */
body {
    padding-top: 56px; /* For fixed navbar */
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 8px 16px;
}

.sidebar .nav-link.active {
    color: #007bff;
    background-color: rgba(0, 123, 255, .1);
}

.sidebar .nav-link:hover {
    color: #007bff;
}

/* Main content */
main {
    padding-top: 20px;
}

/* Cards */
.card {
    margin-bottom: 1.5rem;
    border-radius: 5px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,.125);
}

/* Product cards */
.product-card {
    transition: transform 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-5px);
}

/* File icons */
.file-icon {
    font-size: 2.5rem;
    color: #6c757d;
}

/* Alert messages */
.alert {
    border-radius: 5px;
}

/* Forms */
.form-label {
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 0.375rem 1rem;
    font-weight: 500;
}

/* Profile statistics */
.stat-item {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.stat-item:last-child {
    border-bottom: none;
}

/* Subscription status */
.subscription-status {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
}

.subscription-active {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.subscription-expired {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Download counter */
.download-counter {
    background-color: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    font-size: 0.875rem;
    position: absolute;
    top: -10px;
    right: -10px;
}

/* Pricing cards */
.pricing-card {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    transition: border-color 0.3s ease;
}

.pricing-card:hover {
    border-color: #007bff;
}

.pricing-card.featured {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Footer */
footer {
    background-color: #343a40;
    color: #fff;
    padding: 3rem 0;
    margin-top: 4rem;
}

footer a {
    color: #adb5bd;
    text-decoration: none;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Dashboard stats cards */
.stats-card {
    border-radius: 10px;
    color: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.stats-card h2 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0;
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 2rem 0;
}

/* Error pages */
.error-page {
    text-align: center;
    padding: 5rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        top: 0;
        bottom: 0;
        left: 100%;
        z-index: 1030;
    }
    
    .sidebar.show {
        left: 0;
        box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    }
    
    .navbar-toggler {
        display: block;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Utility classes */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Animation */
.fade-in {
    animation: fadeIn ease 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .container-fluid {
        padding: 0;
    }
}

/* Logo Styling - Fixed Version */
.sidebar-logo {
    width: auto; /* This is crucial - remove fixed width */
    max-width: 180px;
    height: auto; /* Let height adjust proportionally */
    max-height: 40px;
    object-fit: contain;
    display: inline-block;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 220px;
    overflow: hidden;
}

.sidebar-header .logo-container {
    padding: 0.5rem 0;
}

.sidebar-brand {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-brand img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

/* For the admin panel logo preview */
.current-logo img {
    object-fit: contain;
    max-width: 100%;
    height: auto;
    background: rgba(248, 249, 250, 0.5);
    padding: 8px;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
}
