/* حديث اليوم - التصميم الرئيسي */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    direction: rtl;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* شريط حالة الاتصال */
.status-bar {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 8px 16px;
    font-size: 14px;
    text-align: center;
    border-bottom: 2px solid #4caf50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.status-bar.status-offline {
    background: #ffebee;
    color: #c62828;
    border-bottom-color: #f44336;
}

.status-bar.status-updating {
    background: #fff3e0;
    color: #ef6c00;
    border-bottom-color: #ff9800;
}

#statusIcon {
    font-size: 16px;
    margin-left: 8px;
}

#statusText {
    flex: 1;
    text-align: center;
}

#lastUpdate {
    font-size: 12px;
    opacity: 0.8;
}

/* شريط التنقل الثابت */
.navbar {
    background: white;
    border-bottom: 1px solid #e4e6ea;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    border-bottom: 3px solid transparent;
}

.nav-item:hover {
    background: #f0f2f5;
}

.nav-item.active {
    border-bottom-color: #1877f2;
    background: #f0f8ff;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-text {
    font-size: 12px;
    color: #65676b;
    font-weight: 500;
}

.nav-item.active .nav-text {
    color: #1877f2;
    font-weight: 600;
}

/* الصفحات */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Header */
.header {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e4e6ea;
    margin-bottom: 0;
}

.header h1 {
    font-size: 1.8rem;
    color: #1c1e21;
    text-align: center;
    font-weight: 700;
}

.header p {
    font-size: 0.9rem;
    color: #65676b;
    text-align: center;
    margin-top: 5px;
}

/* Idea Form */
.idea-form {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #e4e6ea;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 15px;
}

#publishIdeaText {
    width: 100%;
    min-height: 80px;
    padding: 12px 15px;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    background: #f0f2f5;
    transition: background 0.3s ease;
}

#publishIdeaText:focus {
    outline: none;
    background: #e4e6ea;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.char-count {
    text-align: left;
    font-size: 12px;
    color: #65676b;
}

.char-count.warning {
    color: #f39c12;
}

.char-count.danger {
    color: #e74c3c;
}

.submit-btn {
    background: #1877f2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: #166fe5;
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* My Ideas Section */
.my-ideas-section {
    background: white;
    padding: 20px;
    margin-top: 0;
}

.my-ideas-section h3 {
    font-size: 1.2rem;
    color: #1c1e21;
    margin-bottom: 15px;
    text-align: center;
}

/* Search Section */
.search-section {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e4e6ea;
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e4e6ea;
    border-radius: 25px;
    font-size: 16px;
    font-family: inherit;
    background: #f0f2f5;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #1877f2;
    background: white;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    font-size: 18px;
    color: #65676b;
    pointer-events: none;
}

/* Search Results Section */
.search-results-section {
    background: white;
    padding: 0;
}

/* Ideas Section */
.ideas-section {
    background: white;
    padding: 0;
    min-height: 400px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #65676b;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1877f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-ideas {
    text-align: center;
    padding: 40px 20px;
    color: #65676b;
    background: white;
}

.no-ideas h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #1c1e21;
}

.no-ideas p {
    font-size: 14px;
    line-height: 1.4;
}

/* Load More Button */
.load-more-btn {
    text-align: center;
    padding: 20px;
    background: white;
}

.load-more-btn button {
    background: #1877f2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn button:hover {
    background: #166fe5;
    transform: translateY(-1px);
}

/* Ideas List */
.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.idea-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    border: none;
}

.idea-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.idea-content {
    margin-bottom: 12px;
}

.idea-text {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1c1e21;
    margin-bottom: 12px;
    font-weight: normal;
}

.idea-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #8e8e93;
    margin-bottom: 0;
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.idea-time {
    color: #8e8e93;
}

/* Idea Actions - Facebook Style */
.idea-actions {
    display: flex;
    gap: 0;
    justify-content: flex-start;
    padding-top: 0;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    margin-top: 12px;
}

.vote-btn {
    background: transparent;
    border: none;
    color: #8e8e93;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 120px;
    justify-content: center;
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.vote-btn:hover {
    background: #f0f2f5;
}

.vote-btn.active-vote {
    background: #e3f2fd;
    color: #1877f2;
    font-weight: 600;
}

.vote-btn.active-vote .vote-count {
    color: #1877f2;
    font-weight: 600;
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vote-count {
    font-size: 14px;
    color: #65676b;
}

/* Delete Button for My Ideas */
.delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.delete-btn:hover {
    background: #c0392b;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    .navbar {
        padding: 0;
    }
    
    .nav-text {
        font-size: 11px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .idea-form {
        padding: 16px;
    }
    
    .search-section {
        padding: 12px 16px;
    }
    
    .search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .search-results {
        max-height: 300px;
    }
    
    .idea-card {
        padding: 14px;
        margin-bottom: 16px;
    }
    
    .idea-actions {
        gap: 0;
    }
    
    .vote-btn {
        padding: 8px 12px;
        font-size: 15px;
        max-width: 120px;
    }
    
    .idea-text {
        font-size: 20px;
    }
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .nav-item {
        padding: 8px 4px;
    }
    
    .nav-text {
        font-size: 10px;
    }
    
    .vote-btn {
        padding: 10px 8px;
        font-size: 14px;
        max-width: 100px;
    }
    
    .vote-count {
        font-size: 14px;
    }
    
    .idea-meta {
        font-size: 11px;
    }
}

/* PWA Enhancements */
@media (display-mode: standalone) {
    .navbar {
        padding-top: 20px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #18191a;
    }
    
    .navbar,
    .header,
    .idea-form,
    .idea-card,
    .search-section,
    .search-results-section,
    .my-ideas-section {
        background: #242526;
        color: white;
    }
    
    .idea-text {
        color: #e4e6ea;
    }
    
    #publishIdeaText {
        background: #3a3b3c;
        color: white;
    }
    
    .search-input {
        background: #3a3b3c;
        color: white;
    }
    
    .vote-btn {
        color: #b0b3b8;
    }
    
    .vote-btn:hover {
        background: #3a3b3c;
    }
    
    .vote-btn.active-vote {
        color: #1877f2;
    }
} 