/**
 * Telegram Wall Widget Frontend Styles
 */

.telegram-wall-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.telegram-wall-widget .widget-title {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Posts Container */
.telegram-wall-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual Post */
.telegram-wall-post {
    background: #fff;
    border: 1px solid #e1e3e6;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.2s ease;
}

.telegram-wall-post:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.telegram-wall-post-pinned {
    border-left: 3px solid #24A1DE;
    background: #f8f9fa;
}

/* Post Header */
.telegram-wall-post-header {
    margin-bottom: 12px;
}

/* Author */
.telegram-wall-post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.telegram-wall-author-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.telegram-wall-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.telegram-wall-author-name {
    font-weight: 600;
    color: #24A1DE;
    font-size: 14px;
    line-height: 1.2;
}

.telegram-wall-community-link {
    font-size: 12px;
    color: #818c99;
    text-decoration: none;
}

.telegram-wall-community-link:hover {
    color: #24A1DE;
    text-decoration: underline;
}

.telegram-wall-post-author-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Date */
.telegram-wall-post-date {
    display: block;
    font-size: 12px;
    color: #818c99;
    margin-bottom: 10px;
}

/* Content */
.telegram-wall-post-content {
    margin-bottom: 12px;
}

.telegram-wall-post-text {
    font-size: 14px;
    line-height: 1.5;
    color: #050505;
    word-wrap: break-word;
}

.telegram-wall-post-text a {
    color: #24A1DE;
    text-decoration: none;
}

.telegram-wall-post-text a:hover {
    text-decoration: underline;
}

/* Attachments */
.telegram-wall-post-attachments {
    margin: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.telegram-wall-photo-link {
    display: inline-block;
    border-radius: 4px;
    overflow: hidden;
}

.telegram-wall-post-photo {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

.telegram-wall-post-photo {
    max-height: 300px;
    object-fit: cover;
}

/* Video */
.telegram-wall-post-video {
    position: relative;
    display: inline-block;
    border-radius: 4px;
    overflow: hidden;
}

.telegram-wall-post-video img {
    max-width: 100%;
    height: auto;
    display: block;
}

.telegram-wall-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.telegram-wall-video-play::after {
    content: '';
    border-left: 12px solid rgba(255, 255, 255, 0.9);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    margin-left: 4px;
}

/* Link Preview */
.telegram-wall-link-preview {
    display: flex;
    flex-direction: column;
    border: 1px solid #e1e3e6;
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.telegram-wall-link-preview:hover {
    background: #f5f6f8;
}

.telegram-wall-link-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
}

.telegram-wall-link-title {
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #24A1DE;
}

/* Stats */
.telegram-wall-post-stats {
    display: flex;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid #e1e3e6;
    margin-top: 10px;
}

.telegram-wall-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #818c99;
}

.telegram-wall-stat-icon {
    font-size: 16px;
}

.telegram-wall-stat-count {
    font-weight: 500;
}

.telegram-wall-stat-views .telegram-wall-stat-icon {
    color: #24A1DE;
}

/* View Link */
.telegram-wall-post-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: #24A1DE;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.telegram-wall-post-link:hover {
    background: #1f8cc0;
    text-decoration: none;
    color: #fff;
}

/* More Link */
.telegram-wall-more {
    margin-top: 15px;
    text-align: center;
}

.telegram-wall-more a {
    color: #24A1DE;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.telegram-wall-more a:hover {
    text-decoration: underline;
}

/* Error Messages */
.telegram-wall-error {
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    padding: 12px;
}

.telegram-wall-error p {
    margin: 0;
    color: #c62828;
    font-size: 13px;
}

/* No Posts */
.telegram-wall-no-posts {
    text-align: center;
    color: #818c99;
    padding: 20px;
    font-size: 14px;
}

/* Loading State */
.telegram-wall-loading {
    text-align: center;
    padding: 30px;
    color: #818c99;
}

.telegram-wall-loading::after {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    margin: 10px auto 0;
    border: 3px solid #e1e3e6;
    border-top-color: #24A1DE;
    border-radius: 50%;
    animation: telegram-wall-spin 1s linear infinite;
}

@keyframes telegram-wall-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .telegram-wall-post {
        padding: 12px;
    }

    .telegram-wall-author-name {
        font-size: 13px;
    }

    .telegram-wall-post-text {
        font-size: 13px;
    }

    .telegram-wall-post-stats {
        gap: 10px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .telegram-wall-widget {
        color: #e1e3e6;
    }

    .telegram-wall-widget .widget-title {
        color: #e1e3e6;
    }

    .telegram-wall-post {
        background: #191919;
        border-color: #2a2a2a;
    }

    .telegram-wall-post-pinned {
        background: #1f1f1f;
    }

    .telegram-wall-post-text {
        color: #e1e3e6;
    }

    .telegram-wall-author-name {
        color: #24A1DE;
    }

    .telegram-wall-post-date {
        color: #6a7888;
    }

    .telegram-wall-link-preview {
        border-color: #2a2a2a;
    }

    .telegram-wall-link-preview:hover {
        background: #1f1f1f;
    }

    .telegram-wall-link-title {
        color: #24A1DE;
    }

    .telegram-wall-post-stats {
        border-top-color: #2a2a2a;
    }

    .telegram-wall-stat {
        color: #6a7888;
    }

    .telegram-wall-post-link {
        background: #24A1DE;
    }

    .telegram-wall-post-link:hover {
        background: #1f8cc0;
    }

    .telegram-wall-error {
        background: #2d1f1f;
        border-color: #5c2b2b;
    }

    .telegram-wall-error p {
        color: #ff6b6b;
    }

    .telegram-wall-no-posts {
        color: #6a7888;
    }
}

/* Elementor Specific Styles */
.telegram-wall-elementor-wrapper {
    width: 100%;
}

.telegram-wall-elementor-wrapper .telegram-elementor-title {
    margin-bottom: 15px;
}

.telegram-wall-elementor-placeholder {
    text-align: center;
    padding: 30px;
    background: #f5f6f8;
    border: 2px dashed #e1e3e6;
    border-radius: 8px;
    color: #818c99;
}
