/* ============================================
   PredictionDirectory - Product Hunt Style CSS
   ============================================ */

:root {
    --ph-orange: #ff6154;
    --ph-orange-hover: #e5574b;
    --ph-gray-50: #fafafa;
    --ph-gray-100: #f5f5f5;
    --ph-gray-200: #e5e5e5;
    --ph-gray-300: #d4d4d4;
    --ph-gray-400: #a3a3a3;
    --ph-gray-500: #737373;
    --ph-gray-600: #525252;
    --ph-gray-700: #404040;
    --ph-gray-800: #262626;
    --ph-gray-900: #171717;
    --ph-border: #e5e5e5;
    --ph-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ph-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ph-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ph-radius: 0.5rem;
    --ph-radius-lg: 0.75rem;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--ph-gray-50);
    color: var(--ph-gray-800);
}

html, body {
    height: 100%;
    margin: 0;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--ph-orange);
}

/* ============================================
   Sidebar Navigation
   ============================================ */

.sidebar {
    width: 240px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

.sidebar-header {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar .nav-link {
    padding: 0.625rem 1rem;
    border-radius: var(--ph-radius);
    margin: 0.125rem 0;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background-color: var(--ph-orange);
    color: white !important;
}

.sidebar-footer {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
}

/* Main content area */
.main-content {
    margin-left: 240px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--ph-gray-50);
}

.main-content main {
    flex: 1;
    max-width: 1200px;
}

/* Mobile styles */
@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
}

@media (min-width: 992px) {
    .main-content > .navbar {
        display: none !important;
    }
}

/* Login partial adjustments for sidebar */
.sidebar .nav-link.text-dark {
    color: rgba(255, 255, 255, 0.8) !important;
}

.sidebar .dropdown-menu {
    background-color: #343a40;
    border-color: #495057;
}

.sidebar .dropdown-item {
    color: rgba(255, 255, 255, 0.8);
}

.sidebar .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Footer */
footer {
    background-color: white;
    border-top: 1px solid var(--ph-border);
}

/* ============================================
   Product Hunt Style Cards & Lists
   ============================================ */

/* Product/Item List Container */
.ph-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual Product/Item Card */
.ph-item {
    background: white;
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius-lg);
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.ph-item:hover {
    border-color: var(--ph-gray-300);
    box-shadow: var(--ph-shadow-md);
    transform: translateY(-1px);
}

/* Upvote Button */
.ph-upvote {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0.5rem;
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius);
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--ph-gray-600);
}

.ph-upvote:hover {
    border-color: var(--ph-orange);
    color: var(--ph-orange);
    background: #fff5f4;
}

.ph-upvote-arrow {
    font-size: 0.75rem;
    line-height: 1;
}

.ph-upvote-count {
    font-weight: 700;
    font-size: 0.875rem;
}

/* Rank Number */
.ph-rank {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--ph-gray-400);
    min-width: 2rem;
    text-align: center;
}

/* Thumbnail/Icon */
.ph-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--ph-radius);
    object-fit: cover;
    background: var(--ph-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ph-thumbnail-placeholder {
    width: 80px;
    height: 80px;
    border-radius: var(--ph-radius);
    background: linear-gradient(135deg, var(--ph-gray-100) 0%, var(--ph-gray-200) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--ph-gray-400);
    flex-shrink: 0;
}

/* Content Area */
.ph-content {
    flex: 1;
    min-width: 0;
}

.ph-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ph-gray-900);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.ph-title a {
    color: inherit;
    text-decoration: none;
}

.ph-title a:hover {
    color: var(--ph-orange);
}

.ph-tagline {
    font-size: 0.875rem;
    color: var(--ph-gray-500);
    margin-bottom: 0.5rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ph-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--ph-gray-500);
}

/* Tags */
.ph-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ph-tag {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--ph-gray-100);
    color: var(--ph-gray-600);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.ph-tag:hover {
    background: var(--ph-gray-200);
    color: var(--ph-gray-800);
}

/* Badges */
.ph-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ph-badge-new {
    background: #dcfce7;
    color: #166534;
}

.ph-badge-featured {
    background: #fef3c7;
    color: #92400e;
}

.ph-badge-platform {
    background: var(--ph-gray-100);
    color: var(--ph-gray-600);
}

.ph-badge-polymarket {
    background: #e0e7ff;
    color: #3730a3;
}

.ph-badge-kalshi {
    background: #fce7f3;
    color: #9d174d;
}

/* Actions/Links */
.ph-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ============================================
   Page Headers
   ============================================ */

.ph-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ph-border);
}

.ph-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ph-gray-900);
    margin-bottom: 0.25rem;
}

.ph-page-subtitle {
    font-size: 0.875rem;
    color: var(--ph-gray-500);
}

/* ============================================
   Filter/Search Card
   ============================================ */

.ph-filters {
    background: white;
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.ph-filters .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ph-gray-500);
    margin-bottom: 0.375rem;
}

.ph-filters .form-control,
.ph-filters .form-select {
    border-radius: var(--ph-radius);
    border-color: var(--ph-border);
    font-size: 0.875rem;
}

.ph-filters .form-control:focus,
.ph-filters .form-select:focus {
    border-color: var(--ph-orange);
    box-shadow: 0 0 0 3px rgba(255, 97, 84, 0.1);
}

/* ============================================
   Buttons
   ============================================ */

.btn-ph-primary {
    background: var(--ph-orange);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--ph-radius);
    transition: all 0.2s ease;
}

.btn-ph-primary:hover {
    background: var(--ph-orange-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--ph-shadow-md);
}

.btn-ph-secondary {
    background: white;
    border: 1px solid var(--ph-border);
    color: var(--ph-gray-700);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--ph-radius);
    transition: all 0.2s ease;
}

.btn-ph-secondary:hover {
    background: var(--ph-gray-50);
    border-color: var(--ph-gray-300);
    color: var(--ph-gray-900);
}

.btn-ph-ghost {
    background: transparent;
    border: none;
    color: var(--ph-gray-600);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--ph-radius);
    transition: all 0.2s ease;
}

.btn-ph-ghost:hover {
    background: var(--ph-gray-100);
    color: var(--ph-gray-900);
}

/* ============================================
   Stats & Metrics
   ============================================ */

.ph-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--ph-gray-500);
    font-size: 0.75rem;
}

.ph-stat-icon {
    font-size: 0.875rem;
}

/* ============================================
   Empty State
   ============================================ */

.ph-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    background: white;
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius-lg);
}

.ph-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.ph-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ph-gray-900);
    margin-bottom: 0.5rem;
}

.ph-empty-text {
    color: var(--ph-gray-500);
    font-size: 0.875rem;
}

/* ============================================
   Pagination
   ============================================ */

.ph-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.ph-pagination .page-link {
    border-radius: var(--ph-radius);
    border: 1px solid var(--ph-border);
    color: var(--ph-gray-700);
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.ph-pagination .page-link:hover {
    background: var(--ph-gray-100);
    border-color: var(--ph-gray-300);
}

.ph-pagination .page-item.active .page-link {
    background: var(--ph-orange);
    border-color: var(--ph-orange);
}

.ph-pagination .page-item.disabled .page-link {
    background: var(--ph-gray-50);
    color: var(--ph-gray-400);
}

/* ============================================
   Cards (for detail pages)
   ============================================ */

.ph-card {
    background: white;
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius-lg);
    overflow: hidden;
}

.ph-card-body {
    padding: 1.5rem;
}

.ph-card-footer {
    padding: 1rem 1.5rem;
    background: var(--ph-gray-50);
    border-top: 1px solid var(--ph-border);
}

/* ============================================
   Alert Messages
   ============================================ */

.ph-alert {
    border-radius: var(--ph-radius);
    border: none;
    font-weight: 500;
}

.ph-alert-success {
    background: #dcfce7;
    color: #166534;
}

.ph-alert-info {
    background: #e0f2fe;
    color: #0369a1;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 767.98px) {
    .ph-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .ph-upvote {
        flex-direction: row;
        gap: 0.5rem;
        min-width: auto;
        padding: 0.375rem 0.75rem;
    }

    .ph-rank {
        display: none;
    }

    .ph-thumbnail,
    .ph-thumbnail-placeholder {
        width: 60px;
        height: 60px;
    }

    .ph-actions {
        flex-direction: row;
        width: 100%;
    }

    .ph-actions .btn {
        flex: 1;
    }
}
