/* Sinch RCS Demo - Custom Styles */

:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-bottom: 60px;
}

.navbar {
    background: linear-gradient(90deg, #2c3e50 0%, #3498db 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card {
    border: none;
    border-radius: 12px;
    background: white;
}

.card-header {
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.form-control,
.form-check-input,
textarea {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-control:focus,
textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-text {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.6;
}

.btn-group .btn {
    font-weight: 500;
    border-radius: 6px;
    padding: 10px 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #6c757d;
    border: none;
    border-radius: 6px;
    font-weight: 500;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Stat Box Styling */
.stat-box {
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.stat-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2.5rem;
    line-height: 1;
}

/* Table Styling */
.table {
    font-size: 0.9rem;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.table tbody tr {
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background-color: #f9f9f9;
}

.badge {
    padding: 6px 10px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* Alert Styling */
.alert {
    border-radius: 6px;
    border: none;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Footer */
.footer {
    margin-top: auto;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Code blocks in errors */
code {
    background-color: #f8f9fa;
    color: #d63384;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

/* Utility Classes */
.font-monospace {
    font-family: 'Monaco', 'Courier New', monospace;
}

.text-truncate-long {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: 6px;
        margin-bottom: 8px;
    }

    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#resultsSection {
    animation: fadeIn 0.3s ease;
}

/* Loading State */
.btn:disabled {
    cursor: wait;
}

.rcs-preview-panel {
    position: sticky;
    top: 2rem;
}

.rcs-preview-copy {
    color: #f4f7fb;
    margin-bottom: 1rem;
}

.rcs-preview-copy p {
    color: rgba(244, 247, 251, 0.8);
    font-size: 0.95rem;
}

.rcs-preview-stage {
    max-width: 420px;
    margin: 0 auto;
    background:
        radial-gradient(circle at top, rgba(110, 231, 183, 0.2), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    padding: 1rem;
    border-radius: 30px;
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.25);
}

.card-tab-toolbar {
    display: flex;
    align-items: flex-end;
    min-width: 0;
}

.card-tab-toolbar .nav-tabs {
    flex: 1;
    min-width: 0;
}

#addCardBtn {
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

#addCardBtn:not(:disabled):hover,
#addCardBtn:not(:disabled):focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 0.35rem 0.85rem rgba(13, 110, 253, 0.22);
}

.single-card-tabs #cardTabs {
    overflow: hidden !important;
}

.rcs-carousel-track {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding: 0.15rem 0.1rem 0.65rem;
}

.rcs-carousel-track.single {
    overflow: visible;
}

.carousel-preview-card {
    flex: 0 0 min(88%, 330px);
    scroll-snap-align: center;
    opacity: 0.86;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.rcs-carousel-track.single .carousel-preview-card {
    flex-basis: 100%;
}

.carousel-preview-card.is-active {
    opacity: 1;
    box-shadow: inset 0 0 0 1px rgba(110, 231, 183, 0.45), 0 10px 30px rgba(2, 6, 23, 0.22);
}

.carousel-preview-card .rcs-card-media img {
    display: block;
}

.rcs-card-actions button,
.rcs-outer-actions button {
    border: 0;
    border-radius: 14px;
    padding: 0.7rem 0.85rem;
    color: #f8fafc;
    background: rgba(2, 6, 23, 0.48);
    text-align: left;
}

.rcs-outer-actions {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.rcs-outer-actions button {
    background: rgba(59, 130, 246, 0.35);
    text-align: center;
}

.rcs-message-card {
    border-radius: 24px;
    padding: 0.9rem;
    background: rgba(15, 23, 42, 0.58);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    color: #f8fafc;
}

.rcs-message-timestamp {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(226, 232, 240, 0.78);
    margin-bottom: 0.9rem;
    text-transform: capitalize;
}

.rcs-card-media {
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 1rem;
    position: relative;
}

.rcs-card-media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: none;
}

.rcs-card-media-placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    display: grid;
    place-items: center;
    padding: 1rem;
    text-align: center;
    color: rgba(226, 232, 240, 0.78);
    background:
        linear-gradient(135deg, rgba(110, 231, 183, 0.12), rgba(59, 130, 246, 0.08)),
        rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(226, 232, 240, 0.22);
}

.rcs-card-media-placeholder svg {
    display: block;
    width: 100%;
    height: auto;
}

.rcs-card-copy {
    padding: 0.2rem 0.2rem 0.4rem;
}

.rcs-card-copy h3 {
    margin: 0 0 0.55rem;
    font-size: 1.12rem;
    font-weight: 700;
}

.rcs-card-copy p {
    margin: 0;
    font-size: 0.98rem;
    color: rgba(241, 245, 249, 0.92);
    white-space: pre-wrap;
    word-break: break-word;
}

.rcs-card-actions {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.85rem;
}

.rcs-action-row,
.rcs-action-empty {
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.48);
    min-height: 56px;
}

.rcs-action-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
}

.rcs-action-empty {
    display: grid;
    place-items: center;
    padding: 0.85rem;
    text-align: center;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.86rem;
}

.rcs-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.08);
}

.rcs-action-icon svg {
    width: 20px;
    height: 20px;
}

.rcs-action-copy {
    min-width: 0;
    flex: 1;
}

.rcs-action-label {
    font-size: 0.92rem;
    font-weight: 500;
    color: #f8fafc;
    line-height: 1.2;
}

.rcs-action-meta {
    font-size: 0.8rem;
    color: rgba(226, 232, 240, 0.78);
    word-break: break-word;
    line-height: 1.2;
    margin-top: 0.12rem;
}

@media (max-width: 991px) {
    .rcs-preview-panel {
        position: static;
    }
}
