body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
}

h1, h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input[type="text"],
input[type="datetime-local"],
input[type="url"],
input[type="file"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="datetime-local"]:focus,
input[type="url"]:focus,
input[type="file"]:focus,
textarea:focus {
    border-color: #409eff;
    outline: none;
}

input[type="file"] {
    padding: 0.6rem;
    background: #fff;
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: #409eff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #66b1ff;
}

.secondary-btn {
    background-color: #909399;
    border: none;
    padding: 12px 24px;
    color: white;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: auto !important;
    min-width: 200px;
    font-size: 1rem;
}

.secondary-btn:hover:not(:disabled) {
    background-color: #a6a9ad;
}

.secondary-btn:disabled {
    background-color: #e4e7ed;
    color: #a8abb2;
    cursor: not-allowed;
}

.results-section {
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.post-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.post-text {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #34495e;
    min-height: 1.5rem;
    text-align: left;
    white-space: pre-wrap; /* Preserve line breaks from AI captions */
    font-size: 0.95rem;
    line-height: 1.4;
}

.text-loader {
    font-size: 0.85rem;
    color: #909399;
    font-style: italic;
    animation: pulse 1.5s infinite ease-in-out;
    text-align: center;
    width: 100%;
}

.post-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #e9ecef;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.post-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: none;
}

.post-image-container.ready img {
    display: block;
}

.loader {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #409eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.post-image-container.ready .loader {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.polling-info {
    font-size: 0.9rem;
    color: #606266;
    text-align: center;
    font-style: italic;
}

/* Modal Overlay Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
}

/* Social Mockup Specifics */
.mockup-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f5;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0084ff; /* Brand color placeholder */
    margin-right: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.post-time {
    font-size: 0.75rem;
    color: #65676b;
}

.modal-caption {
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.modal-image-container {
    width: 100%;
    aspect-ratio: 1/1;
    background: #eee;
}

#modalImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mockup-footer {
    padding: 8px 16px;
    border-top: 1px solid #f0f2f5;
    background: #f0f2f5;
}

.footer-actions {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #65676b;
    font-weight: 600;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close-modal:hover {
    color: #bbb;
}

.post-image-container.ready {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.post-image-container.ready:hover {
    transform: scale(1.02);
}

/* Feedback Buttons */
.feedback-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f2f5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-actions.visible {
    opacity: 1;
}

.feedback-btn {
    background: none;
    border: 1px solid #dcdfe6;
    border-radius: 20px;
    padding: 6px 15px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #606266;
}

.feedback-btn.up .icon {
    color: #67c23a;
    filter: drop-shadow(0 0 1px rgba(103, 194, 58, 0.2));
}

.feedback-btn.down .icon {
    color: #f56c6c;
    filter: drop-shadow(0 0 1px rgba(245, 108, 108, 0.2));
}

.feedback-btn:hover {
    background-color: #f5f7fa;
    border-color: #c0c4cc;
}

.feedback-btn.up:hover {
    color: #67c23a;
    border-color: #67c23a;
}

.feedback-btn.down:hover {
    color: #f56c6c;
    border-color: #f56c6c;
}

.feedback-btn.active.up {
    background-color: #f0f9eb;
    color: #67c23a;
    border-color: #67c23a;
}

.feedback-btn.active.down {
    background-color: #fef0f0;
    color: #f56c6c;
    border-color: #f56c6c;
}

.feedback-btn span {
    font-size: 0.8rem;
    font-weight: 600;
}

.status-message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 6px;
    display: none;
    text-align: center;
}

.status-message.success {
    display: block;
    background-color: #f0f9eb;
    color: #67c23a;
    border: 1px solid #e1f3d8;
}

@media (max-width: 600px) {
    .post-grid {
        grid-template-columns: 1fr;
    }
}
