/* v=20250601 */
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 15px;
}

.nav-primary {
    flex: 1;
    margin-left: 20px;
}

.nav-user {
    flex-shrink: 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 5px;
    transition: background 0.3s;
    font-size: 0.88rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

nav a:hover {
    background: rgba(255,255,255,0.2);
}

/* Create Poll button stands out */
.btn-nav-create {
    background: rgba(255,255,255,0.2) !important;
    border: 1px solid rgba(255,255,255,0.4);
    font-weight: 600;
}
.btn-nav-create:hover {
    background: rgba(255,255,255,0.35) !important;
}

/* User nav - icon buttons */
.nav-user a {
    font-size: 1.1rem;
    padding: 6px 8px;
}
.nav-admin {
    font-size: 0.82rem !important;
    background: rgba(220,53,69,0.3) !important;
}
.nav-admin:hover {
    background: rgba(220,53,69,0.5) !important;
}
.nav-logout {
    font-size: 0.82rem !important;
    opacity: 0.8;
}

/* Hamburger button - hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    z-index: 1001;
}
.nav-hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s;
}
.nav-hamburger.is-active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-hamburger.is-active span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Nav wrapper */
.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

@media (max-width: 900px) {
    .nav-hamburger {
        display: flex;
    }
    .nav-wrapper {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        gap: 5px;
    }
    .nav-wrapper.nav-open {
        display: flex;
    }
    .nav-primary,
    .nav-user {
        width: 100%;
        margin: 0;
    }
    .nav-primary ul,
    .nav-user ul {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px;
    }
    .header-content {
        position: relative;
        flex-wrap: nowrap;
        align-items: center;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Auth Box */
.auth-box {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #667eea;
}

.admin-auth-box {
    border-top: 4px solid #dc3545;
}

/* Content Box */
.content-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.main-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.sidebar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 280px;
    max-width: 280px;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
}

.sidebar img,
.sidebar .ad-image {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Poll Cards */
.polls-list {
    display: grid;
    gap: 15px;
}

.poll-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s;
}

.poll-card:hover {
    transform: translateX(5px);
}

.poll-card h4 {
    margin-bottom: 10px;
}

.poll-card a {
    color: #667eea;
    text-decoration: none;
}

.poll-card a:hover {
    text-decoration: underline;
}

.poll-meta {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 5px 0;
}

.poll-votes {
    font-weight: bold;
    color: #667eea;
}

.poll-date {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.category-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card h4 {
    margin-bottom: 10px;
}

.category-card p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Poll Detail */
.poll-detail {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.poll-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.poll-header h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.poll-description,
.poll-goals {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.poll-voting {
    margin: 30px 0;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.option-item:hover {
    background: #e9ecef;
}

.option-item input {
    margin-right: 15px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.result-label {
    font-weight: 600;
    margin-bottom: 8px;
}

.result-bar-container {
    background: #e9ecef;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 5px;
}

.result-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
}

.result-count {
    text-align: right;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Poll Share */
.poll-share {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.share-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Comments */
.poll-comments {
    margin: 30px 0;
}

.comment-form {
    margin-bottom: 20px;
}

.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-date {
    color: #6c757d;
    font-size: 0.85rem;
}

.comment-body {
    color: #333;
}

/* Friends */
.friends-section {
    margin: 30px 0;
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.friend-info {
    flex: 1;
}

.friend-since {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 5px;
}

.friend-actions {
    display: flex;
    gap: 10px;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.status-pending {
    background: #ffc107;
    color: #333;

   .status-success {
       background: #28a745;
       color: white;
   }

   /* User Directory */
   .users-directory {
       display: grid;
       grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
       gap: 15px;
       margin-top: 20px;
   }

   .user-card {
       background: #f8f9fa;
       padding: 20px;
       border-radius: 8px;
       border-left: 4px solid #667eea;
       display: flex;
       justify-content: space-between;
       align-items: center;
       transition: transform 0.2s;
   }

   .user-card:hover {
       transform: translateY(-3px);
       box-shadow: 0 5px 15px rgba(0,0,0,0.1);
   }

   .user-info {
       flex: 1;
   }

   .user-info strong {
       display: block;
       margin-bottom: 5px;
       color: #333;
   }

   .user-info p {
       color: #6c757d;
       font-size: 0.9rem;
       margin: 3px 0;
   }

   .user-stats {
       display: flex;
       gap: 15px;
       margin: 10px 0;
   }

   .user-stats span {
       background: #e9ecef;
       padding: 3px 8px;
       border-radius: 10px;
       font-size: 0.8rem;
       color: #495057;
   }

   .user-joined {
       color: #6c757d;
       font-size: 0.8rem;
       margin-top: 5px;
   }

   .user-actions {
       margin-left: 15px;
   }
}

/* Browse Polls */
.browse-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.search-form input,
.search-form select {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.polls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Admin Styles */
.admin {
    background: #f8f9fa;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #343a40;
    color: white;
    padding: 20px 0;
}

.admin-nav {
    list-style: none;
}

.admin-nav li {
    margin-bottom: 5px;
}

.admin-nav a {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: #495057;
}

.admin-content {
    flex: 1;
    padding: 30px;
}

.admin-content h1 {
    margin-bottom: 30px;
    color: #343a40;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.admin-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #343a40;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

.admin-form {
    max-width: 600px;
    margin-bottom: 30px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Ad Banner — compact sidebar ad */
.ad-sponsored-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 6px;
    display: block;
}

.ad-banner {
    color: white;
    padding: 12px 14px;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.ad-banner h4 {
    margin: 0 0 4px 0;
    font-size: 0.88rem;
    line-height: 1.3;
}

.ad-banner p {
    margin: 0 0 10px 0;
    font-size: 0.78rem;
    line-height: 1.4;
    opacity: 0.92;
}

.ad-banner .btn {
    font-size: 0.75rem;
    padding: 5px 12px;
}

/* Image wrapper — fixed height so it never stretches the ad */
.ad-image-wrap {
    width: 100%;
    height: 90px;
    overflow: hidden;
    border-radius: 5px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.15);
}

.ad-image {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover;
    object-position: center;
    display: block !important;
    border-radius: 5px;
}

/* Sidebar Sections */
.sidebar-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h4 {
    margin-bottom: 15px;
    color: #667eea;
}

.friend-list {
    list-style: none;
}

.friend-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.friend-list li:last-child {
    border-bottom: none;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 10px;
}

/* Footer */
footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }

    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
    }
    
    .nav-primary {
        margin-left: 0;
    }

    .action-buttons {
        flex-direction: column;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .polls-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .auth-box,
    .content-box {
        padding: 15px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .friend-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .friend-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Print Styles */
@media print {
    header,
    .sidebar,
    .admin-sidebar,
    .action-buttons,
    .poll-share,
    .poll-comments,
    footer {
        display: none;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .poll-detail {
        box-shadow: none;
        padding: 0;
    }
}

/* Nav Badge */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 1;
    text-align: center;
    padding: 0 3px;
    position: absolute;
    top: 0px;
    right: 0px;
    pointer-events: none;
    box-shadow: 0 0 0 2px #667eea;
}

/* Unread Badge */
.unread-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Messages Layout */
.messages-layout {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 600px;
}

.messages-sidebar {
    width: 300px;
    min-width: 300px;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.messages-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.messages-sidebar-header h3 {
    margin: 0;
    color: #333;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    gap: 12px;
}

.conversation-item:hover,
.conversation-item.active {
    background: #f0f4ff;
}

.conv-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.conv-avatar.large {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
}

.conv-info {
    flex: 1;
    overflow: hidden;
}

.conv-name {
    font-weight: 600;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
}

.conv-preview {
    font-size: 0.85rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-top: 3px;
}

.friends-start-chat {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
}

.friends-start-chat h4 {
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.friend-chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    text-decoration: none;
    color: #333;
    transition: color 0.2s;
}

.friend-chat-item:hover {
    color: #667eea;
}

.no-messages {
    padding: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Messages Main */
.messages-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.conversation-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.conversation-header h3 {
    margin: 0;
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 450px;
}

.message-bubble {
    max-width: 65%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
}

.message-bubble.sent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    background: #f0f0f0;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.4;
}

.message-time {
    font-size: 0.72rem;
    margin-top: 4px;
    opacity: 0.75;
    text-align: right;
}

.message-form {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    align-items: flex-end;
}

.message-form textarea {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    resize: none;
    font-size: 0.95rem;
    font-family: inherit;
}

.message-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.no-conversation-selected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    padding: 40px;
    text-align: center;
}

.no-conv-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

/* Notifications */
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #e9ecef;
    transition: background 0.2s;
}

.notification-item.unread {
    background: #f0f4ff;
    border-left-color: #667eea;
}

.notif-icon {
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.notif-content {
    flex: 1;
}

.notif-content p {
    margin: 0 0 5px 0;
}

.notif-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.notif-content a:hover {
    text-decoration: underline;
}

.notif-time {
    font-size: 0.8rem;
    color: #6c757d;
}

.notif-actions {
    min-width: 90px;
    text-align: right;
}

.no-notifications {
    padding: 30px;
    text-align: center;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Responsive Messages */
@media (max-width: 768px) {
    .messages-layout {
        flex-direction: column;
    }

    .messages-sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        max-height: 250px;
        overflow-y: auto;
    }

    .message-bubble {
        max-width: 85%;
    }

    .notification-item {
        flex-wrap: wrap;
    }
}

/* ============================================================
   POLL THEMES
   ============================================================ */

/* --- Default (existing purple gradient) --- */
.poll-theme-default .poll-header { border-left: 5px solid #667eea; }
.poll-theme-default .result-bar  { background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); }

/* --- Dark Theme --- */
.poll-theme-dark {
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: 10px;
    padding: 30px;
}
.poll-theme-dark .poll-header       { border-left: 5px solid #e94560; border-bottom-color: #2a2a4a; }
.poll-theme-dark .poll-header h1    { color: #e94560; }
.poll-theme-dark .poll-description,
.poll-theme-dark .poll-goals        { background: #16213e; color: #ccc; }
.poll-theme-dark .option-item       { background: #16213e; color: #e0e0e0; }
.poll-theme-dark .option-item:hover { background: #0f3460; }
.poll-theme-dark .result-item       { background: #16213e; }
.poll-theme-dark .result-bar-container { background: #2a2a4a; }
.poll-theme-dark .result-bar        { background: linear-gradient(90deg, #e94560 0%, #c62a47 100%); }
.poll-theme-dark .result-label      { color: #e0e0e0; }
.poll-theme-dark .result-count      { color: #aaa; }
.poll-theme-dark .poll-comments     { color: #e0e0e0; }
.poll-theme-dark .comment-item      { background: #16213e; border-left: 3px solid #e94560; }
.poll-theme-dark .comment-header    { color: #aaa; }

/* --- Ocean Theme --- */
.poll-theme-ocean {
    background: linear-gradient(135deg, #e0f7fa 0%, #e8f5e9 100%);
    border-radius: 10px;
    padding: 30px;
}
.poll-theme-ocean .poll-header       { border-left: 5px solid #0077b6; border-bottom-color: #b2ebf2; }
.poll-theme-ocean .poll-header h1    { color: #0077b6; }
.poll-theme-ocean .poll-description,
.poll-theme-ocean .poll-goals        { background: #b2ebf2; color: #004d61; }
.poll-theme-ocean .option-item       { background: #e0f7fa; border: 1px solid #b2ebf2; }
.poll-theme-ocean .option-item:hover { background: #b2ebf2; }
.poll-theme-ocean .result-item       { background: #e0f7fa; }
.poll-theme-ocean .result-bar-container { background: #b2ebf2; }
.poll-theme-ocean .result-bar        { background: linear-gradient(90deg, #0077b6 0%, #00b4d8 100%); }
.poll-theme-ocean .comment-item      { background: #e0f7fa; border-left: 3px solid #0077b6; }

/* --- Sunset Theme --- */
.poll-theme-sunset {
    background: linear-gradient(135deg, #fff3e0 0%, #fce4ec 100%);
    border-radius: 10px;
    padding: 30px;
}
.poll-theme-sunset .poll-header       { border-left: 5px solid #ff6b35; border-bottom-color: #ffccbc; }
.poll-theme-sunset .poll-header h1    { color: #ff6b35; }
.poll-theme-sunset .poll-description,
.poll-theme-sunset .poll-goals        { background: #ffccbc; color: #7c3a00; }
.poll-theme-sunset .option-item       { background: #fff3e0; border: 1px solid #ffccbc; }
.poll-theme-sunset .option-item:hover { background: #ffccbc; }
.poll-theme-sunset .result-item       { background: #fff3e0; }
.poll-theme-sunset .result-bar-container { background: #ffccbc; }
.poll-theme-sunset .result-bar        { background: linear-gradient(90deg, #ff6b35 0%, #f7c59f 100%); }
.poll-theme-sunset .comment-item      { background: #fff3e0; border-left: 3px solid #ff6b35; }

/* --- Corporate Theme --- */
.poll-theme-corporate {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 30px;
}
.poll-theme-corporate .poll-header       { border-left: 5px solid #003366; border-bottom-color: #dee2e6; }
.poll-theme-corporate .poll-header h1    { color: #003366; }
.poll-theme-corporate .poll-description,
.poll-theme-corporate .poll-goals        { background: #f0f4f8; color: #333; border: 1px solid #dee2e6; }
.poll-theme-corporate .option-item       { background: #f8f9fa; border: 1px solid #dee2e6; }
.poll-theme-corporate .option-item:hover { background: #e9ecef; }
.poll-theme-corporate .result-item       { background: #f8f9fa; border: 1px solid #dee2e6; }
.poll-theme-corporate .result-bar-container { background: #dee2e6; }
.poll-theme-corporate .result-bar        { background: linear-gradient(90deg, #003366 0%, #0066cc 100%); }
.poll-theme-corporate .comment-item      { background: #f8f9fa; border-left: 3px solid #003366; }

/* Theme picker on create poll page */
.theme-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 8px;
}
.theme-option {
    border: 3px solid transparent;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: border-color 0.2s, transform 0.2s;
}
.theme-option:hover       { transform: translateY(-2px); }
.theme-option.selected    { border-color: #667eea; }
.theme-option input[type="radio"] { display: none; }

.theme-option.t-default   { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.theme-option.t-dark      { background: #1a1a2e; color: #e94560; }
.theme-option.t-ocean     { background: linear-gradient(135deg, #0077b6, #00b4d8); color: white; }
.theme-option.t-sunset    { background: linear-gradient(135deg, #ff6b35, #f7c59f); color: white; }
.theme-option.t-corporate { background: #003366; color: white; }

/* ============================================================
   COMMENTS SECTION
   ============================================================ */
.poll-comments {
    margin: 30px 0;
}
.poll-comments h3 {
    margin-bottom: 20px;
    color: #667eea;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}
.comment-form {
    margin-bottom: 25px;
}
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.95rem;
    min-height: 80px;
    box-sizing: border-box;
}
.comment-form textarea:focus {
    outline: none;
    border-color: #667eea;
}
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.comment-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.comment-author {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}
.comment-date {
    color: #adb5bd;
    font-size: 0.8rem;
}
.comment-body {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
}
.no-comments {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
}
.comment-count-badge {
    background: #667eea;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* ============================================================
   TRENDING PAGE
   ============================================================ */
.trending-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 10px;
    margin-bottom: 25px;
}
.trending-header h1 {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
}
.trending-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}
.trending-grid {
    display: grid;
    gap: 15px;
}
.trending-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}
.trending-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}
.trending-rank {
    font-size: 2rem;
    font-weight: 900;
    color: #dee2e6;
    min-width: 50px;
    text-align: center;
    line-height: 1;
}
.trending-rank.top3 { color: #f5576c; }
.trending-info { flex: 1; }
.trending-info h3 {
    margin: 0 0 6px 0;
    color: #333;
    font-size: 1rem;
}
.trending-meta {
    display: flex;
    gap: 15px;
    font-size: 0.82rem;
    color: #6c757d;
}
.trending-votes {
    font-weight: 700;
    color: #f5576c;
    font-size: 1.1rem;
    text-align: right;
    min-width: 80px;
}
.trending-votes span {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: #adb5bd;
}
.trending-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.trending-empty .empty-icon { font-size: 3rem; margin-bottom: 15px; }

/* ============================================================
   SUPPORT PAGE
   ============================================================ */
.support-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 10px;
    margin-bottom: 25px;
}
.support-header h1 { margin: 0 0 5px 0; }
.support-header p  { margin: 0; opacity: 0.9; font-size: 0.95rem; }
.support-form-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    max-width: 700px;
}
.support-faq {
    background: white;
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-top: 25px;
}
.support-faq h3 {
    color: #667eea;
    margin-bottom: 15px;
}
.faq-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item strong { color: #333; display: block; margin-bottom: 4px; }
.faq-item p { color: #6c757d; margin: 0; font-size: 0.9rem; }

/* Admin support inbox */
.support-ticket {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #667eea;
}
.support-ticket.resolved { border-left-color: #28a745; opacity: 0.75; }
.support-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.support-ticket-meta { font-size: 0.82rem; color: #6c757d; margin-top: 4px; }
.support-ticket-body { color: #333; line-height: 1.6; margin: 10px 0; }
.support-reply-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.support-reply-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    min-height: 70px;
    box-sizing: border-box;
    margin-bottom: 8px;
}

/* ============================================================
   POLL ANALYTICS
   ============================================================ */
.analytics-box {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-top: 20px;
}
.analytics-box h3 {
    color: #667eea;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}
.analytics-section h4 {
    color: #495057;
    margin-bottom: 12px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.option-bar-row {
    margin-bottom: 10px;
}
.option-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #333;
}
.option-bar-track {
    background: #e9ecef;
    border-radius: 10px;
    height: 22px;
    overflow: hidden;
}
.option-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.5s;
}
.country-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.country-table th {
    text-align: left;
    padding: 6px 10px;
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
}
.country-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
.country-table tr:last-child td { border-bottom: none; }
.analytics-stat-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.analytics-stat {
    flex: 1;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}
.analytics-stat .stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
}
.analytics-stat .stat-label {
    font-size: 0.78rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .theme-picker         { grid-template-columns: repeat(2, 1fr); }
    .analytics-grid       { grid-template-columns: 1fr; }
    .trending-card        { flex-wrap: wrap; }
}

/* ── Profile Pages ─────────────────────────────────────────── */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
    max-width: 900px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .profile-layout { grid-template-columns: 1fr; }
}
.profile-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
    height: fit-content;
}
.profile-avatar-wrap {
    margin-bottom: 15px;
}
.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
}
.profile-display-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #333;
}
.profile-username {
    color: #999;
    font-size: 0.9rem;
    margin: 0 0 12px;
}
.profile-bio {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 15px;
}
.profile-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.profile-stat {
    text-align: center;
}
.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #667eea;
}
.stat-label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.profile-joined {
    font-size: 0.8rem;
    color: #bbb;
    margin-top: 10px;
}
.profile-edit {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.profile-edit h3 {
    margin: 0 0 20px;
    font-size: 1.1rem;
    color: #333;
}
.form-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}
.form-section legend {
    font-weight: 600;
    color: #667eea;
    padding: 0 8px;
    font-size: 0.9rem;
}

/* ── Auth Pages ─────────────────────────────────────────────── */
.auth-page { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-container { width: 100%; max-width: 420px; padding: 20px; }
.auth-box { background: #fff; border-radius: 16px; padding: 35px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-box h2 { text-align: center; margin: 0 0 8px; color: #333; }
.auth-subtitle { text-align: center; color: #999; font-size: 0.9rem; margin-bottom: 20px; }
.auth-links { text-align: center; margin-top: 20px; font-size: 0.9rem; color: #999; }
.auth-links a { color: #667eea; text-decoration: none; }
.btn-block { width: 100%; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 25px; flex-wrap: wrap; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* ── Poll Card Enhancements ─────────────────────────────────── */
.poll-card .poll-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Admin Cleanup Page ─────────────────────────────────────── */
.btn-danger { background: #e74c3c; color: #fff; border: none; }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: #27ae60; color: #fff; border: none; }
.btn-success:hover { background: #219a52; }

/* ── Password Strength ──────────────────────────────────────── */
.password-strength { min-height: 18px; }
