/* 
 * v4u Frontend Styles
 * Version: 0.0.1-dev
 */

/* General v4u styles */
.v4u-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.v4u-card {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.v4u-button {
    background: #1da1f2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.v4u-button:hover {
    background: #1991da;
    color: white;
}

.v4u-button.secondary {
    background: #657786;
}

.v4u-button.secondary:hover {
    background: #5b6770;
}

.v4u-button.danger {
    background: #e0245e;
}

.v4u-button.danger:hover {
    background: #d01d52;
}

/* Creator Profile Styles */
.v4u-creator-profile {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.v4u-creator-avatar {
    flex-shrink: 0;
}

.v4u-creator-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.v4u-creator-info h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.v4u-creator-bio {
    color: #657786;
    line-height: 1.5;
    margin-bottom: 20px;
}

.v4u-subscription-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.v4u-tier-card {
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
}

.v4u-tier-card.featured {
    border-color: #1da1f2;
    background: linear-gradient(135deg, #f8fcff 0%, #f0f8ff 100%);
}

.v4u-tier-price {
    font-size: 32px;
    font-weight: 700;
    color: #1da1f2;
    margin: 10px 0;
}

.v4u-tier-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.v4u-tier-features li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

/* Content Grid */
.v4u-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.v4u-content-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.v4u-content-item img,
.v4u-content-item video {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.v4u-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 20px;
}

.v4u-content-locked {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    text-align: center;
}

/* Messaging Styles */
.v4u-messages-container {
    max-width: 800px;
    margin: 0 auto;
}

.v4u-message {
    display: flex;
    margin-bottom: 20px;
    gap: 15px;
}

.v4u-message.sent {
    flex-direction: row-reverse;
}

.v4u-message-avatar {
    flex-shrink: 0;
}

.v4u-message-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.v4u-message-content {
    background: #f1f3f4;
    padding: 15px;
    border-radius: 18px;
    max-width: 70%;
}

.v4u-message.sent .v4u-message-content {
    background: #1da1f2;
    color: white;
}

.v4u-message-composer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e1e8ed;
    padding: 20px;
}

.v4u-message-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.v4u-message-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e1e8ed;
    border-radius: 20px;
    outline: none;
}

/* Dashboard Styles */
.v4u-dashboard-nav {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f1f3f4;
}

.v4u-dashboard-nav a {
    padding: 15px 0;
    text-decoration: none;
    color: #657786;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.v4u-dashboard-nav a.active,
.v4u-dashboard-nav a:hover {
    color: #1da1f2;
    border-bottom-color: #1da1f2;
}

.v4u-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.v4u-stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    text-align: center;
}

.v4u-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1da1f2;
}

.v4u-stat-label {
    color: #657786;
    margin-top: 5px;
}

/* User Dashboard Styles */
.v4u-user-dashboard {
    background: #f7f9fa;
    min-height: 100vh;
    padding: 20px 0;
}

.dashboard-header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-header h1 {
    margin: 0;
    color: #1a1a1a;
    font-size: 32px;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #e1e8ed;
}

.user-details h3 {
    margin: 0 0 5px 0;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
}

.user-email {
    margin: 0;
    color: #657786;
    font-size: 14px;
}

/* Dashboard Navigation */
.dashboard-navigation {
    margin-bottom: 30px;
}

.dashboard-nav {
    display: flex;
    gap: 5px;
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #657786;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    background: #f7f9fa;
    color: #1a1a1a;
}

.nav-btn.active {
    background: #1da1f2;
    color: white;
}

.nav-btn i {
    font-size: 16px;
}

/* Dashboard Content */
.dashboard-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f7f9fa;
}

.tab-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 700;
}

.tab-actions {
    display: flex;
    gap: 10px;
}

/* Subscriptions Grid */
.subscriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.subscription-card {
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    background: white;
}

.subscription-card:hover {
    border-color: #1da1f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.1);
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.creator-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.creator-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #e1e8ed;
}

.creator-details h4 {
    margin: 0 0 4px 0;
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
}

.tier-name {
    margin: 0;
    color: #657786;
    font-size: 14px;
}

.subscription-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-expired {
    background: #e2e3e5;
    color: #383d41;
}

.subscription-details {
    margin: 15px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.detail-label {
    color: #657786;
    font-size: 14px;
}

.detail-value {
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
}

.subscription-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e8ed;
}

/* Payment History Table */
.payments-table {
    overflow-x: auto;
}

.payments-table table {
    width: 100%;
    border-collapse: collapse;
}

.payments-table th,
.payments-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.payments-table th {
    background: #f7f9fa;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 14px;
}

.payments-table td {
    color: #14171a;
    font-size: 14px;
}

.payment-type {
    text-transform: capitalize;
}

.payment-amount {
    font-weight: 600;
    color: #1da1f2;
}

.payment-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Settings Forms */
.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.settings-section {
    padding: 25px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    background: #fafbfc;
}

.settings-section h3 {
    margin: 0 0 20px 0;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    color: #14171a;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1da1f2;
}

/* Loading States */
.v4u-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1da1f2;
    border-radius: 50%;
    animation: v4u-spin 1s linear infinite;
}

@keyframes v4u-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Styles */
.v4u-form-group {
    margin-bottom: 20px;
}

.v4u-form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.v4u-form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.v4u-form-input:focus {
    border-color: #1da1f2;
}

.v4u-form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Notifications */
.v4u-notification {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.v4u-notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.v4u-notification.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.v4u-notification.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.v4u-notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Subscription Modal Styles */
.v4u-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h2,
.modal-content h3 {
    margin: 0 0 20px 0;
    color: #1a1a1a;
    font-weight: 700;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #657786;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    color: #1a1a1a;
}

/* Subscription Tiers */
.tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 30px;
}

.subscription-tier-card {
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
}

.subscription-tier-card:hover {
    border-color: #1da1f2;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(29, 161, 242, 0.15);
}

.tier-header {
    margin-bottom: 20px;
}

.tier-name {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.tier-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.price-amount {
    font-size: 32px;
    font-weight: 700;
    color: #1da1f2;
}

.price-period {
    font-size: 16px;
    color: #657786;
}

.tier-description {
    margin-bottom: 20px;
    color: #14171a;
    font-size: 14px;
    line-height: 1.5;
}

.tier-benefits {
    margin-bottom: 25px;
    text-align: left;
}

.tier-benefits h4 {
    margin: 0 0 12px 0;
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
}

.tier-benefits ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.tier-benefits li {
    position: relative;
    margin-bottom: 8px;
    color: #14171a;
    font-size: 14px;
    padding-left: 20px;
}

.tier-benefits li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #1da1f2;
    font-weight: bold;
}

.tier-actions {
    margin-top: 20px;
}

.tier-select-btn {
    width: 100%;
    padding: 12px 20px;
    background: #1da1f2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tier-select-btn:hover {
    background: #1991da;
}

/* Enhanced Button Styles */
.v4u-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    justify-content: center;
}

.v4u-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.v4u-btn-primary {
    background: #1da1f2;
    color: white;
}

.v4u-btn-primary:hover {
    background: #1991da;
    color: white;
}

.v4u-btn-secondary {
    background: #657786;
    color: white;
}

.v4u-btn-secondary:hover {
    background: #5b6770;
    color: white;
}

.v4u-btn-outline {
    background: transparent;
    color: #1da1f2;
    border: 2px solid #1da1f2;
}

.v4u-btn-outline:hover {
    background: #1da1f2;
    color: white;
}

.v4u-btn-danger {
    background: #e0245e;
    color: white;
}

.v4u-btn-danger:hover {
    background: #c91e56;
}

/* Loading and States */
.v4u-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.v4u-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e1e8ed;
    border-top: 4px solid #1da1f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #657786;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    color: #e1e8ed;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #1a1a1a;
    font-size: 20px;
}

.empty-state p {
    margin: 0 0 20px 0;
    color: #657786;
}

/* Enhanced Notifications */
.v4u-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1001;
    min-width: 300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.v4u-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.v4u-notification-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.v4u-notification-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    color: inherit;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
}

/* Processing Modal */
.processing-content {
    text-align: center;
    padding: 60px 40px;
}

.processing-content h3 {
    margin: 20px 0 10px 0;
    color: #1a1a1a;
}

.processing-content p {
    margin: 0;
    color: #657786;
}

/* ===== EARNINGS DASHBOARD STYLES ===== */
.earnings-dashboard {
    padding: 20px;
}

.earnings-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.earnings-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.earnings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.earnings-card h3 {
    margin: 0 0 12px 0;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.earnings-amount {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.earnings-section {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.earnings-section h3 {
    margin: 0 0 20px 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.earnings-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.earning-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.earning-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.earning-type {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.earning-date {
    color: #6b7280;
    font-size: 12px;
}

.earning-amount {
    font-weight: 700;
    color: #059669;
    font-size: 16px;
}

.monthly-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.month-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.month-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.month-amount {
    font-weight: 700;
    color: #1f2937;
    font-size: 16px;
}

/* Responsive earnings dashboard */
@media (max-width: 768px) {
    .earnings-overview {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .earnings-card {
        padding: 20px;
    }
    
    .earnings-amount {
        font-size: 24px;
    }
    
    .earnings-section {
        padding: 20px;
    }
    
    .earning-item,
    .month-item {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .earnings-overview {
        grid-template-columns: 1fr;
    }
    
    .earning-item,
    .month-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .earning-amount,
    .month-amount {
        align-self: flex-end;
    }
}

/* Section highlighting effect */
.highlight-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); 
    }
    50% { 
        box-shadow: 0 0 0 10px rgba(14, 165, 233, 0.2); 
    }
}
