/* Account Area Styles */

:root {
    --blue: #2563eb;
    --green: #10b981;
    --gold: #f59e0b;
    --text: #333;
    --text-light: #666;
    --bg: #f9fafb;
    --white: #ffffff;
    --border: #e5e7eb;
    --danger: #e74c3c;
}

.dashboard-container {
    min-height: calc(100vh - 80px);
    background: var(--bg);
    padding: 40px 0;
}

.dashboard-header {
    margin-bottom: 3rem;
    text-align: center;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--blue);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1);
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 0.25rem;
}

.stat-subtext {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Dashboard Sections */
.dashboard-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.dashboard-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.dashboard-section.danger {
    border-color: #ffebee;
    background: #fffafa;
}

.dashboard-section.danger h2 {
    color: var(--danger);
}

.dashboard-section.danger p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.action-card {
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
    color: inherit;
}

.action-card:hover {
    border-color: var(--blue);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1);
    transform: translateY(-3px);
}

.action-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.action-card h3 {
    margin: 0.75rem 0 0.5rem;
    color: var(--text);
}

.action-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Profile Section */
.profile-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.profile-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.profile-section small {
    color: var(--text-light);
    font-size: 0.85rem;
    display: block;
    margin-top: 0.25rem;
}

.profile-section.danger {
    border-color: #ffebee;
    background: #fffafa;
}

.profile-section.danger h2 {
    color: var(--danger);
}

.profile-section.danger p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.profile-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input[readonly] {
    background: var(--bg);
    cursor: not-allowed;
}

/* Form Messages */
.form-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Subscription Section */
.subscription-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.subscription-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.subscription-section.danger {
    border-color: #ffebee;
    background: #fffafa;
}

.subscription-section.danger h2 {
    color: var(--danger);
}

.subscription-section.danger p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.current-plan-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.plan-badge {
    display: inline-block;
    background: var(--blue);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.plan-details {
    margin-bottom: 1.5rem;
}

.plan-details h3 {
    margin-bottom: 0.5rem;
}

.plan-details p {
    color: var(--text-light);
    margin: 0;
}

.plan-info {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.plan-dates {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.plan-date-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.plan-date-item .date-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.plan-date-item span:last-child {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.status-active {
    font-weight: 600;
    color: var(--green);
}

.status-trial {
    font-weight: 600;
    color: var(--gold);
}

.status-cancelled,
.status-inactive {
    font-weight: 600;
    color: var(--danger);
}

.trial-info {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--gold);
    color: #92400e;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.plan-features {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 1.5rem;
}

.plan-features h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.plan-features ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.plan-features li {
    color: var(--text-light);
}

.plan-features li:before {
    content: '✓ ';
    color: var(--green);
    font-weight: 700;
    margin-right: 0.5rem;
}

.plan-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Billing */
.billing-info {
    background: var(--bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.billing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.billing-item:last-child {
    border-bottom: none;
}

.billing-item label {
    color: var(--text-light);
    font-weight: 500;
}

.billing-item strong {
    color: var(--text);
}

/* Invoices Table */
.invoices-container {
    min-height: 100px;
}

.invoices-table {
    width: 100%;
    border-collapse: collapse;
}

.invoices-table th,
.invoices-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.invoices-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
}

.invoices-table td {
    color: var(--text-light);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-light);
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Connection Cards */
.connection-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.connection-card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.connection-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-light);
}

.connection-disconnected,
.connection-connected {
    padding: 1rem 0;
}

.qr-container {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.qr-container img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
}

.qr-container p {
    margin: 1rem 0 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 16px;
    background: #d1fae5;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.connection-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
}

.connection-status .status-text {
    color: #065f46;
    font-weight: 500;
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.connection-info-icon {
    font-size: 1.5rem;
}

.connection-info-details {
    flex: 1;
}

.connection-info-details p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.connection-info-details strong {
    color: var(--text);
    display: block;
    margin-bottom: 0.25rem;
}

.connection-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Google Connect Button */
.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-google:hover {
    border-color: var(--blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Overview Cards */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.overview-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.overview-card h3 {
    margin: 0 0 1rem;
    color: var(--text);
    font-size: 1.1rem;
}

.overview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.overview-item:last-child {
    border-bottom: none;
}

.overview-item label {
    color: var(--text-light);
}

.overview-item .value {
    font-weight: 600;
    color: var(--text);
}

/* Connection Status Dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.connected {
    background: var(--green);
}

.status-dot.disconnected {
    background: #d1d5db;
}

.status-dot.error {
    background: var(--danger);
}

.connection-status-item {
    display: flex;
    align-items: center;
}

.connection-status-item .status-text {
    font-size: 0.9rem;
}

/* App Access Card */
.app-access-card {
    background: linear-gradient(135deg, var(--blue) 0%, #1e40af 100%);
    border-radius: 12px;
    padding: 2rem;
    color: var(--white);
    text-align: center;
}

.app-access-card h3 {
    margin: 0 0 0.5rem;
    color: var(--white);
}

.app-access-card p {
    margin: 0 0 1.5rem;
    opacity: 0.9;
}

.app-access-card .btn {
    background: var(--white);
    color: var(--blue);
}

.app-access-card .btn:hover {
    background: var(--bg);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
}

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--white);
    color: var(--blue);
    border: 2px solid var(--blue);
}

.btn-secondary:hover {
    background: var(--blue);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c7372f;
    transform: translateY(-2px);
}

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

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.quick-link:hover {
    border-color: var(--blue);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
    transform: translateY(-4px);
}

.quick-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-radius: 12px;
}

.quick-content h4 {
    margin: 0 0 4px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.quick-content p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue) 0%, #1e40af 100%);
    border-radius: 10px;
    color: var(--white);
}

.card-body {
    margin-bottom: 1rem;
}

.card-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Plan display in overview */
.plan-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 0.5rem;
}

.plan-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.plan-status.active {
    background: #d1fae5;
    color: #065f46;
}

.plan-status.trial {
    background: #fef3c7;
    color: #92400e;
}

.plan-status.pending {
    background: #e0e7ff;
    color: #3730a3;
}

/* Plan Expiry */
.plan-expiry {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.plan-expiry .expiry-label {
    font-weight: 600;
    color: var(--text);
}

/* Connection Items in overview */
.connection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.connection-item:last-child {
    border-bottom: none;
}

.connection-name {
    color: var(--text);
    font-weight: 500;
}

.connection-item .connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    padding: 0;
    margin: 0;
}

.connection-item .connection-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
}

.connection-item .connection-status .status-dot.connected {
    background: var(--green);
}

.connection-item .connection-status .status-dot.error {
    background: var(--danger);
}

.connection-item .connection-status .status-text {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* App Description */
.app-description {
    color: var(--text-light);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Button sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-content {
        text-align: center;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .billing-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .invoices-table {
        font-size: 0.9rem;
    }

    .invoices-table th,
    .invoices-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 20px 0;
    }

    .dashboard-section,
    .profile-section,
    .subscription-section,
    .connection-card,
    .overview-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .connection-actions {
        flex-direction: column;
    }

    .connection-actions .btn {
        width: 100%;
    }

    .quick-links {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .quick-link {
        padding: 1rem;
    }

    .quick-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}
