/* Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.card:hover::before {
    opacity: 1;
}

/* Form Elements */
.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus, .form-select, .funnel-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;

    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23A1A1AA' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
}

.form-select:hover, .funnel-select:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-primary);
}

.form-select option, .funnel-select option {
    background: var(--secondary-bg);
    color: var(--text-primary);
}

/* Character Counter */
.char-counter {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* Option Grids */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.delivery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.publish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Option Selectors */
.content-type-option, .button-type-option, .publish-option, .delivery-option {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.content-type-option:hover, .button-type-option:hover, .publish-option:hover, .delivery-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.content-type-option.active, .button-type-option.active, .publish-option.active, .delivery-option.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.option-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.option-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.option-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area.drag-over {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.upload-placeholder {
    color: var(--text-secondary);
}

.upload-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.preview-container {
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

/* Post Preview */
.post-preview {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 1rem;
}

.preview-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.channel-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.channel-name {
    font-weight: 600;
    color: var(--text-primary);
}

.post-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preview-content {
    padding: 1.5rem;
}

.preview-media {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.preview-media img, .preview-media video {
    width: 100%;
    height: auto;
    display: block;
}

.preview-text {
    line-height: 1.5;
    margin-bottom: 1rem;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.preview-button {
    margin-top: 1rem;
}

.preview-button-element {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Button Styles */
.btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    text-align: center;
    justify-content: center;
    font-family: inherit;
    min-height: 48px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-success), #059669);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-warning), #d97706);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-danger), #dc2626);
    color: white;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label:hover .checkmark {
    border-color: var(--accent-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 18, 0.95);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
    padding: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
}

.loading-content p {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.loading-spinner.large {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    animation: toastSlideIn 0.3s ease-out;
    max-width: 400px;
}

.toast.success {
    border-left: 4px solid var(--accent-success);
}

.toast.error {
    border-left: 4px solid var(--accent-danger);
}

.toast.warning {
    border-left: 4px solid var(--accent-warning);
}

.toast.info {
    border-left: 4px solid var(--accent-info);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.25rem;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Action Buttons - с fallback */
.action-buttons {
    /* Flexbox fallback */
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
    
    /* Grid если поддерживается */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 1.5rem;
}

.action-buttons > * {
    flex: 1 1 250px;
    min-width: 250px;
}

@supports (display: grid) {
    .action-buttons > * {
        flex: none;
        min-width: auto;
    }
}

.action-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--glass-bg), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.2);
}

.action-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.action-title {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.action-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

/* Cohort Analysis Table */
.cohort-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cohort-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    min-width: 600px;
}

.cohort-table thead tr {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.cohort-table th {
    padding: 1rem 0.75rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.cohort-table .cohort-header-lm {
    text-align: left;
    min-width: 140px;
    max-width: 140px;
}

.cohort-table .cohort-header-subs {
    min-width: 80px;
    max-width: 80px;
}

.cohort-table .cohort-header-period {
    min-width: 70px;
    max-width: 70px;
}

.cohort-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.cohort-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.cohort-table td {
    padding: 0.75rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.cohort-table .cohort-cell-lm {
    text-align: left;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cohort-table .cohort-cell-subs {
    font-weight: 600;
    color: var(--text-accent);
}

.cohort-table .cohort-cell-rate {
    font-weight: 600;
    font-family: var(--font-mono);
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.cohort-table .cohort-cell-rate:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Responsive для таблицы когорт */
@media (max-width: 768px) {
    .cohort-table-wrapper {
        font-size: 0.75rem;
    }
    
    .cohort-table th,
    .cohort-table td {
        padding: 0.5rem 0.375rem;
    }
    
    .cohort-table .cohort-header-lm,
    .cohort-table .cohort-cell-lm {
        max-width: 100px;
    }
    
    .cohort-table .cohort-header-period {
        min-width: 50px;
        max-width: 50px;
    }
}

/* External Link Section */
.external-link-section {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.external-link-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.external-link-icon {
    font-size: 1.2rem;
}

.external-link-title {
    font-weight: 600;
    color: var(--text-primary);
}

.welcome-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.external-link-url {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.external-link-url:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(59, 130, 246, 0.5);
}

.btn-copy-link {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.btn-copy-link:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Leadmagnet Status Updates */
.leadmagnet-status .mode-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.leadmagnet-status .date-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* SVG Icons */
.svg-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: middle;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.svg-icon.large {
    width: 2.5rem;
    height: 2.5rem;
}

.svg-icon.medium {
    width: 1.25rem;
    height: 1.25rem;
}

.svg-icon.small {
    width: 1rem;
    height: 1rem;
}

/* Icon specific styles */
.icon-refresh {
    animation: none;
    transition: transform 0.3s ease;
}

.icon-refresh.spinning {
    animation: spin 1s linear infinite;
}

.icon-export {
    fill: currentColor;
}

.icon-chart {
    fill: currentColor;
}

/* Button SVG icons adjustments */
.btn .svg-icon {
    margin-right: 0.5rem;
}

.action-icon .svg-icon {
    color: var(--accent-primary);
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
}

.action-icon .svg-icon.large {
    margin-bottom: 0.5rem;
}

/* Hover effects for action buttons */
.action-btn:hover .svg-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.4));
}

.btn:hover .svg-icon.icon-refresh {
    transform: rotate(180deg);
}

