@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #0088cc;
    --secondary-color: #f0f2f5;
    --text-color: #333;
    --light-text: #777;
    --bg-color: rgba(255, 255, 255, 0.15);
    --border-color: rgba(255, 255, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --spoiler-bg: #000;
    --spoiler-text: #000;
    --success-color: #4caf50;
    --error-color: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.telegram-card {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.header {
    padding: 20px;
    background: rgba(0, 136, 204, 0.7);
    color: white;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2rem;
    margin-right: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 500;
}

.header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.chat-container {
    padding: 20px;
}

.message-preview {
    background: var(--bg-color);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px dashed var(--border-color);
}

.file-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.file-preview-area p {
    color: var(--light-text);
    font-style: italic;
    width: 100%;
    text-align: center;
    margin: auto;
}

.file-preview-item {
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-preview-item i {
    margin-right: 8px;
    color: var(--primary-color);
}

.file-preview-item .remove-file {
    margin-left: 8px;
    cursor: pointer;
    color: var(--light-text);
    transition: color 0.2s;
}

.file-preview-item .remove-file:hover {
    color: var(--error-color);
}

.text-editor {
    margin-bottom: 15px;
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.formatting-toolbar {
    display: flex;
    padding: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid var(--border-color);
}

.format-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    margin-right: 5px;
    transition: all 0.2s;
}

.format-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.format-btn.active {
    background: var(--primary-color);
    color: white;
}

#message-input {
    min-height: 100px;
    padding: 15px;
    outline: none;
    overflow-y: auto;
}

#message-input:empty:before {
    content: attr(placeholder);
    color: var(--light-text);
    pointer-events: none;
    display: block;
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.1);
}

.file-upload-area:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
}

.file-upload-area i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.file-upload-area p {
    color: var(--text-color);
    font-size: 0.9rem;
}

.file-upload-area.highlight {
    background: rgba(0, 136, 204, 0.1);
    border-color: var(--primary-color);
}

.progress-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    height: 30px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}

.send-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: #0078b5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.send-btn i {
    margin-right: 8px;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* Text formatting styles */
.bold {
    font-weight: bold;
}

.italic {
    font-style: italic;
}

.spoiler {
    background-color: var(--spoiler-bg);
    color: var(--spoiler-text);
    transition: all 0.3s;
    cursor: pointer;
    border-radius: 3px;
    padding: 0 2px;
}

.spoiler:hover {
    background-color: transparent;
    color: inherit;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .telegram-card {
        border-radius: 0;
        max-width: 100%;
        min-height: 100vh;
    }
    
    .container {
        padding: 0;
    }
    
    .file-upload-area {
        padding: 20px;
    }
}
