/* Global styles */
:root {
    --primary-color: #f8bbd0;
    --secondary-color: #c8e6c9;
    --accent-color: #bbdefb;
    --text-color: #5d4037;
    --background-color: #fff9f9;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M30,50 Q50,30 70,50 Q50,70 30,50 Z" fill="%23f8bbd0" opacity="0.1"/><path d="M20,30 Q30,10 40,30 Q30,50 20,30 Z" fill="%23c8e6c9" opacity="0.1"/><path d="M60,30 Q70,10 80,30 Q70,50 60,30 Z" fill="%23bbdefb" opacity="0.1"/><path d="M20,70 Q30,50 40,70 Q30,90 20,70 Z" fill="%23f8bbd0" opacity="0.1"/><path d="M60,70 Q70,50 80,70 Q70,90 60,70 Z" fill="%23c8e6c9" opacity="0.1"/></svg>');
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 15px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M30,50 Q50,30 70,50 Q50,70 30,50 Z" fill="white" opacity="0.2"/></svg>');
    opacity: 0.5;
}

header::after {
    content: "";
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M30,50 Q50,30 70,50 Q50,70 30,50 Z" fill="white" opacity="0.2"/></svg>');
    opacity: 0.5;
}

.site-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #6a1b9a;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    color: #6a1b9a;
    opacity: 0.8;
}

/* Section styles */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 1024px) {
    main {
        grid-template-columns: 1fr 1fr;
    }
}

.posts-section, .comments-section {
    background-color: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 20px;
    border: 2px solid var(--primary-color);
    position: relative;
    width: 100%;
}

.posts-section::before, .comments-section::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 20px;
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg width="30" height="30" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"><path d="M15,5 Q20,0 25,5 Q30,10 25,15 Q20,20 15,15 Q10,20 5,15 Q0,10 5,5 Q10,0 15,5 Z" fill="%23f8bbd0"/></svg>');
    z-index: 10;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    color: var(--text-color);
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-color);
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Pinboard styles */
.pinboard {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    min-height: 400px;
    background-color: #fffef0;
    padding: 20px;
    border-radius: 10px;
    position: relative;
}

.pinboard::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="1" fill="%23c8e6c9"/></svg>');
    opacity: 0.3;
    pointer-events: none;
    border-radius: 10px;
}

.post {
    min-width: 180px;
    max-width: 300px;
    width: auto;
    height: auto;
    min-height: 120px;
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    cursor: grab;
    position: relative;
    transition: var(--transition);
    z-index: 1;
    overflow: hidden;
    flex: 0 1 auto;
    margin: 5px;
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.post:active {
    transform: scale(0.98);
}

.post::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg width="30" height="30" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"><path d="M0,0 L30,0 L30,30 Q15,20 0,30 Z" fill="white" opacity="0.3"/></svg>');
    pointer-events: none;
}

.post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.post-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-right: 10px;
    word-break: break-word;
}

.post-actions {
    display: flex;
    gap: 8px;
}

.post-content {
    font-size: 0.9rem;
    word-break: break-word;
}

/* Comments section styles */
.comments-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.selected-post-info {
    background-color: var(--secondary-color);
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    font-weight: 500;
}

.comment-input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

#comment-input {
    min-height: 120px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
}

#comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

#comments-list::-webkit-scrollbar {
    width: 6px;
}

#comments-list::-webkit-scrollbar-track {
    background: transparent;
}

#comments-list::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

.comment {
    background-color: var(--accent-color);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.3s ease;
    width: 100%;
}

.comment-text {
    flex: 1;
    margin-right: 12px;
    word-break: break-word;
}

.no-comments {
    text-align: center;
    padding: 15px;
    color: #888;
    font-style: italic;
}

/* Button and input styles */
.action-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    min-height: 44px;
    font-size: 0.95rem;
}

.action-btn:hover {
    background-color: #f48fb1;
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.warning {
    background-color: #ffcdd2;
}

.warning:hover {
    background-color: #ef9a9a;
}

.btn-icon {
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
}

.btn-icon:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.8);
}

.copy-btn {
    padding: 8px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.7);
}

.search-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 300px;
}

.search-container input {
    padding: 12px;
    border: 1px solid var(--primary-color);
    border-radius: 8px 0 0 8px;
    font-family: inherit;
    width: 100%;
    font-size: 0.95rem;
    min-height: 44px;
}

.search-container input:focus {
    outline: none;
    border-color: #f48fb1;
    box-shadow: 0 0 0 2px rgba(244, 143, 177, 0.2);
}

.search-container button {
    padding: 12px 15px;
    border: none;
    background-color: var(--primary-color);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    color: var(--text-color);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-container button:hover {
    background-color: #f48fb1;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #f48fb1;
    box-shadow: 0 0 0 2px rgba(244, 143, 177, 0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}

/* Footer styles */
footer {
    margin-top: 40px;
    text-align: center;
    padding: 20px;
    color: var(--text-color);
    opacity: 0.7;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dragging {
    opacity: 0.8;
    cursor: grabbing;
}

/* Toast styles */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    text-align: center;
    font-weight: 500;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.post.selected {
    outline: 3px solid #9c27b0;
    box-shadow: 0 0 15px rgba(156, 39, 176, 0.3);
}

/* Responsive adjustments */
@media (max-width: 1023px) {
    .container {
        padding: 15px;
    }
    
    main {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .site-title {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .controls {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .pinboard {
        padding: 15px;
        min-height: 300px;
    }
    
    .post {
        margin: 5px auto;
    }
}

@media (max-width: 600px) {
    .site-title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .post {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        margin: 5px 0;
    }
    
    .action-btn {
        padding: 12px;
        width: 100%;
    }
    
    .comment-input-container {
        gap: 10px;
    }
    
    #comment-input {
        min-height: 100px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .comments-section, .posts-section {
        padding: 15px;
    }
    
    .modal-content {
        padding: 20px 15px;
        width: 95%;
    }
    
    .form-group input, .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .controls > * {
        width: 100%;
    }
    
    .comment {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .comment-text {
        margin-right: 0;
        width: 100%;
    }
    
    .copy-btn {
        align-self: flex-end;
    }
    
    .post-actions {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: rgba(255, 255, 255, 0.8);
        border-radius: 20px;
        padding: 4px;
    }
    
    .comment-actions {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 375px) {
    .container {
        padding: 10px;
    }
    
    .site-title {
        font-size: 1.6rem;
    }
    
    .post-title {
        font-size: 1rem;
    }
}

.comment-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.secondary {
    background-color: var(--accent-color);
}

.secondary:hover {
    background-color: #a1c4fc;
} 