/* ========================================
   CryptoSafeInvest - Component Styles
   Author: CryptoSafeInvest Team
   Version: 1.0
======================================== */

/* ========================================
   Card Components
======================================== */

/* Glass Card Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
}

/* Hover Card */
.hover-card {
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.hover-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
    transform: translateX(-100%);
    transition: transform var(--transition-base);
}

.hover-card:hover::before {
    transform: translateX(0);
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* Stats Card */
.stats-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    border: 1px solid var(--neutral-200);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition-base);
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

.stats-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-100), var(--secondary-100));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-card-content {
    flex: 1;
}

.stats-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neutral-900);
    line-height: 1.2;
}

.stats-card-label {
    font-size: 0.875rem;
    color: var(--neutral-500);
}

.stats-card-trend {
    font-size: 0.875rem;
    font-weight: 600;
}

.stats-card-trend.positive {
    color: var(--success);
}

.stats-card-trend.negative {
    color: var(--error);
}

/* ========================================
   Badge Components
======================================== */

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.success {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.status-badge.error {
    background: var(--error-light);
    color: var(--error);
}

.status-badge.neutral {
    background: var(--neutral-100);
    color: var(--neutral-600);
}

/* Number Badge */
.number-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-600);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon Badge */
.icon-badge {
    position: relative;
    display: inline-block;
}

.icon-badge::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid white;
}

/* ========================================
   Tooltip Components
======================================== */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--neutral-900);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-popover);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: var(--neutral-900) transparent transparent transparent;
}

/* ========================================
   Alert Components
======================================== */

.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: var(--success-light);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-error {
    background: var(--error-light);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-info {
    background: var(--primary-100);
    border: 1px solid var(--primary-500);
    color: var(--primary-700);
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
    font-size: 0.875rem;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: currentColor;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

/* ========================================
   Modal Components
======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: var(--radius-2xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--neutral-500);
    transition: color var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--neutral-900);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--neutral-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

/* ========================================
   Dropdown Components
======================================== */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xs) 0;
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: var(--neutral-100);
}

.dropdown-divider {
    height: 1px;
    background: var(--neutral-200);
    margin: var(--space-xs) 0;
}

/* ========================================
   Tab Components
======================================== */

.tabs {
    display: flex;
    border-bottom: 2px solid var(--neutral-200);
    margin-bottom: var(--space-lg);
}

.tab {
    padding: var(--space-sm) var(--space-lg);
    cursor: pointer;
    font-weight: 600;
    color: var(--neutral-500);
    position: relative;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--primary-600);
}

.tab.active {
    color: var(--primary-600);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-600);
}

/* Pills Tabs */
.pills-tabs {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.pill-tab {
    padding: var(--space-xs) var(--space-md);
    background: var(--neutral-100);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--neutral-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pill-tab:hover {
    background: var(--neutral-200);
    color: var(--neutral-800);
}

.pill-tab.active {
    background: var(--primary-600);
    color: white;
}

/* ========================================
   Accordion Components
======================================== */

.accordion-item {
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
    overflow: hidden;
}

.accordion-header {
    padding: var(--space-md);
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: background var(--transition-fast);
}

.accordion-header:hover {
    background: var(--neutral-50);
}

.accordion-icon {
    transition: transform var(--transition-base);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 var(--space-md);
    max-height: 0;
    overflow: hidden;
    transition: all var(--transition-base);
    background: var(--neutral-50);
}

.accordion-item.active .accordion-content {
    padding: var(--space-md);
    max-height: 200px;
}

/* ========================================
   Progress Components
======================================== */

.progress {
    width: 100%;
    height: 8px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-600), var(--secondary-500));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Circular Progress */
.circular-progress {
    width: 100px;
    height: 100px;
    position: relative;
}

.circular-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.circular-progress-bg {
    stroke: var(--neutral-200);
}

.circular-progress-fill {
    stroke: var(--primary-600);
    stroke-dasharray: 283;
    stroke-dashoffset: calc(283 - (283 * var(--progress)) / 100);
    transition: stroke-dashoffset 0.3s;
}

.circular-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--neutral-900);
}

/* ========================================
   Skeleton Loading
======================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--neutral-200) 25%,
        var(--neutral-100) 50%,
        var(--neutral-200) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-button {
    height: 40px;
    width: 120px;
}

/* ========================================
   Pagination Components
======================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-xl);
}

.page-item {
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: white;
    border: 1px solid var(--neutral-200);
    color: var(--neutral-700);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.page-link:hover {
    background: var(--neutral-100);
    border-color: var(--primary-300);
}

.page-item.active .page-link {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}

/* ========================================
   Breadcrumb Components
======================================== */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: var(--space-sm) 0;
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 var(--space-sm);
    color: var(--neutral-400);
}

.breadcrumb-item a {
    color: var(--neutral-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--primary-600);
}

.breadcrumb-item.active {
    color: var(--neutral-900);
    font-weight: 500;
}

/* ========================================
   Timeline Components
======================================== */

.timeline {
    position: relative;
    padding-left: var(--space-xl);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--neutral-200);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-xl);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -29px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary-600);
    z-index: 1;
}

.timeline-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--neutral-200);
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-bottom: var(--space-xs);
}

.timeline-title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.timeline-text {
    font-size: 0.875rem;
    color: var(--neutral-600);
}

/* ========================================
   Rating Components
======================================== */

.rating {
    display: flex;
    gap: 2px;
}

.rating-star {
    width: 20px;
    height: 20px;
    background: var(--neutral-200);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.rating-star.filled {
    background: #FFB800;
}

.rating-star.half-filled {
    background: linear-gradient(90deg, #FFB800 50%, var(--neutral-200) 50%);
}

.rating-score {
    font-weight: 600;
    color: var(--neutral-700);
    margin-left: var(--space-xs);
}

/* ========================================
   Avatar Components
======================================== */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
}

.avatar-xl {
    width: 80px;
    height: 80px;
}

.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group .avatar {
    border: 2px solid white;
    margin-left: -10px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

.avatar-group .avatar-count {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--neutral-100);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-700);
    margin-left: -10px;
}

/* ========================================
   Tag Components
======================================== */

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--neutral-100);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--neutral-700);
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--neutral-200);
}

.tag-close {
    margin-left: var(--space-xs);
    cursor: pointer;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    font-size: 0.75rem;
}

.tag-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Colored Tags */
.tag-primary {
    background: var(--primary-100);
    color: var(--primary-700);
}

.tag-success {
    background: var(--success-light);
    color: var(--success);
}

.tag-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.tag-error {
    background: var(--error-light);
    color: var(--error);
}

/* ========================================
   Divider Components
======================================== */

.divider {
    width: 100%;
    height: 1px;
    background: var(--neutral-200);
    margin: var(--space-lg) 0;
}

.divider-vertical {
    width: 1px;
    height: 100%;
    background: var(--neutral-200);
    margin: 0 var(--space-lg);
}

.divider-text {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--neutral-500);
    font-size: 0.875rem;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--neutral-200);
}

/* ========================================
   Statistic Components
======================================== */

.statistic {
    text-align: center;
    padding: var(--space-lg);
}

.statistic-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--neutral-900);
    line-height: 1.2;
    margin-bottom: var(--space-xs);
}

.statistic-label {
    font-size: 0.875rem;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.statistic-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: var(--space-sm);
}

.statistic-trend.up {
    background: var(--success-light);
    color: var(--success);
}

.statistic-trend.down {
    background: var(--error-light);
    color: var(--error);
}

/* ========================================
   Feature Comparison Table
======================================== */

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.comparison-table th {
    background: var(--primary-900);
    color: white;
    padding: var(--space-lg);
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--neutral-200);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:hover td {
    background: var(--neutral-50);
}

.comparison-feature {
    font-weight: 600;
    color: var(--neutral-900);
}

.comparison-check {
    color: var(--success);
    font-weight: 700;
}

.comparison-minus {
    color: var(--neutral-400);
}

/* ========================================
   Price Card Components
======================================== */

.price-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    border: 2px solid var(--neutral-200);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.price-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-400);
    box-shadow: var(--shadow-xl);
}

.price-card.popular {
    border-color: var(--accent-600);
    transform: scale(1.05);
}

.price-card.popular:hover {
    transform: scale(1.05) translateY(-5px);
}

.popular-badge {
    position: absolute;
    top: 12px;
    right: -30px;
    background: var(--accent-600);
    color: var(--neutral-900);
    padding: 4px 30px;
    font-size: 0.75rem;
    font-weight: 600;
    transform: rotate(45deg);
}

.price-card-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.price-card-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.price-card-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-700);
}

.price-card-period {
    font-size: 0.875rem;
    color: var(--neutral-500);
}

.price-card-features {
    list-style: none;
    margin: var(--space-lg) 0;
}

.price-card-features li {
    padding: var(--space-sm) 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--neutral-700);
}

.price-card-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
}

.price-card .btn {
    width: 100%;
}

/* ========================================
   Cookie Consent
======================================== */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: var(--space-md);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: var(--z-fixed);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    animation: slideUp 0.3s ease;
}

.cookie-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
}

.cookie-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-text {
    font-size: 0.875rem;
    color: var(--neutral-600);
}

.cookie-text a {
    color: var(--primary-600);
    text-decoration: none;
}

.cookie-buttons {
    display: flex;
    gap: var(--space-sm);
}

/* ========================================
   Loading States
======================================== */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--neutral-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-600);
    border-radius: 50%;
    animation: bounce 0.8s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.loading-pulse {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-600), transparent);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   Empty States
======================================== */

.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    color: var(--neutral-700);
    margin-bottom: var(--space-sm);
}

.empty-state-text {
    color: var(--neutral-500);
    margin-bottom: var(--space-lg);
}

/* ========================================
   Print Styles
======================================== */

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card,
    .modal-container,
    .price-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    a {
        text-decoration: none;
        color: black;
    }
}