:root {
    --primary-color: #ec224f;
    --primary-hover: #c9183e;
    --bg-color: #f7f9fa;
    --card-bg: #ffffff;
    --text-color: #2b2b2b;
    --text-muted: #666666;
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111;
}

.logo span {
    color: var(--primary-color);
}

.nav-badge {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.main-layout {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
}

.category-tag {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

h1 {
    font-size: 2.2rem;
    line-height: 1.25;
    margin: 10px 0 20px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.avatar {
    width: 45px;
    height: 45px;
    background: #0f1923;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.author-name, .target-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hero-image-container {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #0f1923 0%, #1f2326 100%);
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.hero-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hero-right {
    width: 40%;
    height: 100%;
    background: #000;
}

.side-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-overlay {
    background: rgba(0, 0, 0, 0.75);
    color: #ff4655;
    padding: 10px 20px;
    border: 2px solid #ff4655;
    font-weight: 900;
    letter-spacing: 2px;
    border-radius: 4px;
}

.petition-text h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.petition-text p {
    margin-bottom: 15px;
    color: #4a5568;
}

.widget-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    position: sticky;
    top: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.big-number {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-color);
    display: block;
    line-height: 1;
}

.goal-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #edf2f7;
    border-radius: 5px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.5s ease-in-out;
}

.urgency-alert {
    background: #fff5f5;
    border-left: 3px solid var(--primary-color);
    padding: 10px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    margin-bottom: 20px;
}

.btn-sign {
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-sign:hover {
    background: var(--primary-hover);
}

.qr-share-box {
    margin-top: 25px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.qr-share-box p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.qr-share-box img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

/* CHAT STYLES */
.chat-bubble-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 999;
}

.chat-window {
    display: none;
    position: fixed;
    bottom: 70px;
    left: 20px;
    width: 320px;
    height: 420px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chat-window.fullscreen {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    z-index: 2000;
}

.chat-header {
    background: #0f1923;
    color: white;
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-controls {
    display: flex;
    gap: 8px;
}

.chat-action-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 5px;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
}

.chat-msg {
    font-size: 0.85rem;
    background: white;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    word-break: break-word;
}

.delete-msg-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    font-weight: bold;
    cursor: pointer;
    float: right;
    margin-left: 8px;
}

.emoji-bar {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    background: #edf2f7;
    border-top: 1px solid var(--border-color);
    overflow-x: auto;
}

.emoji-btn {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.emoji-btn:hover {
    background: #e2e8f0;
}

#chat-form {
    padding: 10px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#chat-form input {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.close-btn {
    position: absolute;
    right: 15px; top: 10px;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}