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

/* Root Variables */
:root {
    --primary-color: #000;
    --secondary-color: #666;
    --bg-color: #fff;
    --text-color: #333;
    --border-color: #ddd;
    --hover-color: #f5f5f5;
    --button-bg: #000;
    --button-text: #fff;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    gap: 10px;
}

.logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.logo span {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav a:hover {
    color: var(--primary-color);
}

.btn-submit {
    background: var(--button-bg);
    color: var(--button-text) !important;
    padding: 10px 25px;
    border-radius: 5px;
    transition: opacity 0.3s;
}

.btn-submit:hover {
    opacity: 0.8;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0 40px;
    background: linear-gradient(to bottom, #f9f9f9, #fff);
}

.hero h1 {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 20px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.stats {
    font-size: 16px;
    color: var(--secondary-color);
    margin-bottom: 30px;
}

/* Search Box */
.search-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: var(--primary-color);
}

.search-box button {
    padding: 15px 30px;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.search-box button:hover {
    opacity: 0.8;
}

/* Messages Section */
.messages-section {
    padding: 40px 0 80px;
}

.messages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.message-card {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.message-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.message-header {
    padding: 15px;
    background: #f9f9f9;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.message-icon {
    width: 30px;
    height: 30px;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 14px;
}

.message-body {
    padding: 20px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

.message-text {
    max-height: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.message-footer {
    padding: 10px 15px;
    background: #f9f9f9;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--secondary-color);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--secondary-color);
    font-size: 18px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 0;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 30px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    z-index: 1;
}

.close:hover {
    color: #000;
}

#modal-body {
    padding: 40px 30px 20px;
}

.modal-message {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.modal-actions {
    padding: 20px 30px;
    text-align: center;
}

.btn-share {
    padding: 12px 40px;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-share:hover {
    opacity: 0.8;
}

/* Submit Page */
.submit-section {
    padding: 40px 0 80px;
    min-height: calc(100vh - 200px);
}

.submit-section h1 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 15px;
}

.form-description {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 40px;
}

.submit-container {
    max-width: 700px;
    margin: 0 auto;
}

/* Color Selector */
.color-selector {
    margin-bottom: 30px;
}

.color-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.color-option.selected {
    border: 3px solid #000;
    transform: scale(1.15);
}

/* Message Form */
.message-form {
    margin-bottom: 30px;
}

.form-preview {
    border: 3px solid #000;
    border-radius: 10px;
    overflow: hidden;
    background: #FFB3BA;
    transition: background-color 0.3s;
}

.preview-header {
    background: #f9f9f9;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 3px solid #000;
}

.preview-icon {
    width: 35px;
    height: 35px;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-weight: bold;
    font-size: 14px;
}

.preview-header input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
    font-weight: 500;
}

.preview-header input::placeholder {
    color: #999;
}

.form-preview textarea {
    width: 100%;
    min-height: 250px;
    padding: 30px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-family: inherit;
    resize: none;
    outline: none;
    color: #000;
}

.preview-footer {
    background: #f9f9f9;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 3px solid #000;
}

.btn-send {
    background: #000;
    color: #fff;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-send:hover {
    opacity: 0.8;
}

.hashtag {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: #666;
}

.btn-back {
    background: #666;
    color: #fff;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-back:hover {
    opacity: 0.8;
}

.btn-submit-main {
    width: 100%;
    padding: 18px;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-submit-main:hover {
    opacity: 0.8;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 60px 30px;
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 10px;
    max-width: 600px;
    margin: 40px auto;
}

.success-message h3 {
    color: #16a34a;
    font-size: 32px;
    margin-bottom: 15px;
}

.success-message p {
    color: #166534;
    font-size: 16px;
    margin-bottom: 25px;
}

.btn-back-home {
    padding: 12px 30px;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-back-home:hover {
    opacity: 0.8;
}

/* About Page */
.about-section {
    padding: 60px 0 80px;
}

.about-section h1 {
    font-size: 42px;
    margin-bottom: 40px;
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.about-content h2 {
    font-size: 28px;
    margin: 40px 0 20px;
}

.about-content p {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.about-content ul, .about-content ol {
    margin: 20px 0 20px 30px;
    color: var(--secondary-color);
}

.about-content li {
    margin-bottom: 10px;
}

.cta-box {
    background: #f9f9f9;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    margin-top: 50px;
}

.cta-box h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background: var(--button-bg);
    color: var(--button-text);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    opacity: 0.8;
}

/* Footer */
.footer {
    background: #f9f9f9;
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
}

.footer-links a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .messages-grid {
        grid-template-columns: 1fr;
    }
    
    .color-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .nav {
        gap: 15px;
    }
    
    .modal-content {
        margin: 10% 20px;
    }
}

@media (max-width: 480px) {
    .logo span {
        display: none;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box button {
        width: 100%;
    }
}