/* Pinky Bot Dashboard Styles - with Light/Dark Mode */

/* Dark Mode Variables (Default) */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --accent-primary: #3b82f6;
}

/* Light Mode Variables - Darker for better visibility */
html.light-mode {
    --bg-primary: #e8ecf1;
    --bg-secondary: #d1d9e3;
    --bg-tertiary: #bcc4d1;
    --text-primary: #0f172a;
    --text-secondary: #1e293b;
    --accent-primary: #2563eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Hamburger Menu for Mobile */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #667eea;
    margin: 5px 0;
    transition: 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Header */
.dashboard-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo .icon {
    font-size: 2.5em;
}

.logo h1 {
    color: #667eea;
    font-size: 1.8em;
}

.status-indicators {
    display: flex;
    gap: 25px;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #e8f0ff;
    border-radius: 20px;
    font-size: 1em;
    font-weight: 600;
    color: #667eea;
    border: 2px solid #667eea;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 80px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    padding: 20px;
    overflow-y: auto;
}

.sidebar h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bot-nav, .view-nav {
    margin-bottom: 30px;
}

.bot-button, .view-button {
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;
    border: none;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1em;
}

.bot-button:hover, .view-button:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.bot-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bot-icon {
    font-size: 1.5em;
}

.bot-name {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.bot-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
}

.bot-status.offline {
    background: #dc3545;
}

/* Main Content */
.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view h2 {
    color: white;
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 25px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

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

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.stat-icon {
    font-size: 3em;
}

.stat-content {
    flex: 1;
}

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

.stat-label {
    color: #666;
    font-size: 0.95em;
    margin-top: 5px;
}

/* Quick Actions */
.quick-actions {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.quick-actions h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    padding: 15px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.action-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.action-icon {
    font-size: 1.5em;
}

/* Recent Activity */
.recent-activity {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.recent-activity h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 15px;
    border-left: 4px solid #667eea;
    background: #f8f9fa;
    margin-bottom: 10px;
    border-radius: 5px;
    display: grid;
    grid-template-columns: 100px 120px 1fr;
    gap: 15px;
}

.activity-time {
    color: #666;
    font-size: 0.85em;
}

.activity-bot {
    color: #667eea;
    font-weight: 600;
}

.activity-message {
    color: #333;
}

/* Pinky Activity Monitor */
.pinky-monitor {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.pinky-monitor h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.monitor-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.monitor-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.monitor-btn-thinking {
    background: #764ba2;
    color: white;
}

.monitor-btn-peak {
    background: #f093fb;
    color: white;
}

.monitor-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.monitor-btn.active {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.monitor-content {
    display: none;
}

.monitor-content.active {
    display: block;
}

.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

@media screen and (max-width: 768px) {
    /* Show hamburger menu */
    .menu-toggle {
        display: block;
    }
    
    /* Header adjustments */
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        padding-top: 60px; /* Space for hamburger */
    }
    
    .logo h1 {
        font-size: 1.5em;
    }
    
    .status-indicators {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .indicator {
        width: 100%;
        justify-content: center;
    }
    
    /* Sidebar - collapsible on mobile */
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding-top: 60px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Content takes full width on mobile */
    .content {
        width: 100%;
        padding: 15px;
    }
    
    /* Stats grid - single column on mobile */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    /* Action buttons - stack on mobile */
    .action-grid {
        grid-template-columns: 1fr !important;
    }
    
    .action-btn {
        padding: 18px;
        font-size: 1.1em;
    }
    
    /* Monitor buttons stack on mobile */
    .monitor-buttons {
        flex-direction: column;
    }
    
    .monitor-btn {
        width: 100%;
        padding: 18px;
    }
    
    /* Activity feed adjustments */
    .activity-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }
    
    .activity-time {
        font-size: 0.8em;
    }
    
    .activity-bot {
        font-size: 0.95em;
    }
    
    /* View titles */
    .view h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    /* Stat cards - bigger touch targets */
    .stat-card {
        padding: 20px;
        min-height: 100px;
    }
    
    .stat-value {
        font-size: 2em;
    }
    
    /* Button group */
    .button-group {
        flex-direction: column;
    }
    
    /* Chart containers */
    .chart-container {
        height: 250px;
    }
}

/* Extra small devices (phones in portrait) */
@media screen and (max-width: 480px) {
    .logo h1 {
        font-size: 1.2em;
    }
    
    .logo .icon {
        font-size: 2em;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
    
    .stat-label {
        font-size: 0.85em;
    }
    
    .action-btn {
        padding: 15px;
        font-size: 1em;
    }
    
    .action-icon {
        font-size: 1.3em;
    }
}

/* Landscape mode tablets */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Bot Interactive Interface Styles */
.bot-interface {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
}

.bot-interface h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.input-panel {
    margin-bottom: 25px;
}

.bot-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.bot-input:focus {
    outline: none;
    border-color: #667eea;
}

.input-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.template-select {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
}

.submit-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.output-panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.output-panel h4 {
    color: #667eea;
    margin-bottom: 15px;
}

.bot-output {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 15px;
}

.output-placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 50px 20px;
}

.output-loading {
    color: #667eea;
    text-align: center;
    padding: 50px 20px;
    animation: pulse 1.5s infinite;
}

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

.btn-small {
    padding: 8px 15px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Responsive for Bot Interface */
@media (max-width: 768px) {
    .bot-interface {
        padding: 15px;
    }
    
    .input-controls {
        flex-direction: column;
    }
    
    .template-select, .submit-btn {
        width: 100%;
    }
    
    .output-actions {
        flex-wrap: wrap;
    }
    
    .btn-small {
        flex: 1;
        min-width: 120px;
    }
}

/* Cache Clear Button */
.cache-clear-btn {
    padding: 8px 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 10px;
}

.cache-clear-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.cache-clear-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .cache-clear-btn {
        font-size: 0.75em;
        padding: 6px 10px;
    }
}

/* ========================================
   SOCIALBOT UI STYLES
   ======================================== */

.social-company-selector-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.social-company-selector-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.company-selector-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.company-selector-btn {
    padding: 20px 15px;
    border: 3px solid #e9ecef;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
}

.company-selector-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: translateY(-2px);
}

.company-selector-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.company-icon {
    font-size: 2.5em;
}

.company-name {
    font-size: 0.95em;
    text-align: center;
}

/* Tab Navigation */
.social-tab-nav {
    display: flex;
    gap: 10px;
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.social-tab-button {
    padding: 12px 20px;
    border: none;
    background: #f8f9fa;
    color: #666;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1em;
}

.social-tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.social-tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Tab Content */
.social-tab-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease;
}

.social-tab-content h3 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.3em;
}

/* Company Grid */
.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.company-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.5);
}

.card-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
}

.card-name {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.card-desc {
    font-size: 0.9em;
    margin-bottom: 15px;
    opacity: 0.9;
}

.card-platforms {
    font-size: 0.85em;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.3);
}

/* Create Post Form */
.create-post-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.05em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 150px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.05em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #667eea;
    border: 2px solid #667eea;
}

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

/* Posts List */
.posts-list {
    max-width: 700px;
    margin: 0 auto;
}

.post-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.post-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateX(5px);
}

.post-item.scheduled {
    border-left-color: #f093fb;
    background: rgba(240, 147, 251, 0.1);
}

.post-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.post-company {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.post-platform {
    background: #764ba2;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.post-date {
    color: #999;
    font-size: 0.85em;
    margin-left: auto;
}

.post-content {
    color: #333;
    line-height: 1.6;
    font-size: 0.95em;
}

/* Responsive Social Bot UI */
@media (max-width: 768px) {
    .company-selector-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .company-grid {
        grid-template-columns: 1fr;
    }
    
    .social-tab-nav {
        flex-direction: column;
    }
    
    .social-tab-button {
        width: 100%;
    }
    
    .social-tab-content {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .post-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .post-date {
        margin-left: 0;
    }
}
