@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&family=Noto+Serif:wght@400;700&display=swap');

:root {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --primary-soft: #fff7ed;
}

/* Tailwind CSS 3.x Directives */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Portfolio button styles */
.portfolio-button {
    @apply px-4 py-2 rounded-lg font-medium transition-colors;
    @apply bg-orange-500 text-white hover:bg-orange-600;
}

/* Dropdown menu styles */
.dropdown-menu {
    @apply bg-white border border-gray-200 rounded-lg shadow-lg;
}

.dropdown-item {
    @apply px-4 py-2 text-gray-700 hover:bg-gray-100;
}

.dropdown-item.active {
    @apply bg-orange-500 text-white hover:bg-orange-600;
}

/* Custom Base Styles */
@layer base {
body {
    font-family: 'Manrope', 'Hanken Grotesk', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-serif {
    font-family: 'Noto Serif', serif;
}

    /* Custom scrollbar for better aesthetics */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f3f4f6; /* gray-100 */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db; /* gray-300 */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af; /* gray-400 */
}
}

@layer components {
/* Modal base styles */
.custom-modal.hidden {
    display: none;
}

.custom-modal {
    transition: opacity 0.2s ease-out;
}
.custom-modal .modal-content { 
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
}
.custom-modal:not(.hidden) { /* When modal is to be shown */
    opacity: 1;
}
.custom-modal:not(.hidden) .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Active time range button style */
.time-range-btn.active {
    background-color: var(--primary-color);
    color: #ffffff;
}
.time-range-btn:not(.active) {
    background-color: #e5e7eb; /* gray-200 */
    color: #374151; /* gray-700 */
}
.time-range-btn:not(.active):hover {
    background-color: #d1d5db; /* gray-300 */
}

/* Transaction Accordion Styles */
.transaction-details-row.hidden {
    display: none;
}

.transaction-details-row td {
    border-top: 1px solid #e5e7eb; /* gray-200 */
    border-bottom: 1px solid #e5e7eb; /* gray-200 */
}

.transaction-details-content {
    max-height: 300px; /* Optional: if many transactions, make it scrollable */
    overflow-y: auto;
}
.transaction-details-content table th,
.transaction-details-content table td {
    padding: 0.5rem 1rem; /* Adjust padding for inner table */
    font-size: 0.8rem; /* Smaller font for transaction details */
}

.expand-transaction-btn .chevron-icon {
    transition: transform 0.2s ease-in-out;
}

.expand-transaction-btn[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.asset-summary-row:hover .expand-transaction-btn {
    background-color: #f3f4f6; /* gray-100, subtle hover on button when row is hovered */
}
.asset-summary-row {
    cursor: default; /* Default cursor for summary row, expand button is the trigger */
}
.expand-transaction-btn {
    cursor: pointer;
}

/* Table sorting styles */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable:hover {
    background-color: #f9fafb; /* gray-50 */
}

.sortable.active-sort {
    background-color: #eff6ff; /* blue-50 */
}

.sort-icons {
    margin-left: 0.5rem;
    display: inline-flex;
    flex-direction: column;
    font-size: 0.75rem;
    line-height: 1;
}

.sort-icons i {
    color: #9ca3af; /* gray-400 */
    transition: color 0.2s ease;
}

/* Pasta Grafiği Modern Tasarım */
#holdingsDonutChart {
    transition: all 0.3s ease;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
}

#holdingsDonutChart:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.15));
}

/* Varlık Dağılımı Kartı */
.chart-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

    .chart-container:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }

    .shadow-modern {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                    0 4px 6px -2px rgba(0, 0, 0, 0.05),
                    0 0 0 1px rgba(255, 255, 255, 0.05);
    }

    .shadow-modern-hover:hover {
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                    0 10px 10px -5px rgba(0, 0, 0, 0.04),
                    0 0 0 1px rgba(255, 255, 255, 0.05);
    }

    .chart-colors {
        --chart-1: #3b82f6;
        --chart-2: #10b981;
        --chart-3: #f59e0b;
        --chart-4: #ef4444;
        --chart-5: #8b5cf6;
        --chart-6: #06b6d4;
        --chart-7: #84cc16;
        --chart-8: #f97316;
    }
}

@layer utilities {
    .profit {
        color: #10B981; /* Tailwind green-500 */
    }

    .loss {
        color: #EF4444; /* Tailwind red-500 */
    }

    /* Style for empty row message */
    #empty-row td {
        border-bottom-width: 0px; /* Remove border if it's the only row */
    }

    .animate-pulse-glow {
        animation: pulse-glow 2s ease-in-out infinite;
    }

    .animate-gradient {
        animation: gradient-shift 3s ease infinite;
        background-size: 200% 200%;
    }

    /* Transform utilities */
    .rotate-90 {
        transform: rotate(90deg);
    }

    .rotate-0 {
        transform: rotate(0deg);
    }

    /* Visibility utilities */
    .invisible {
        visibility: hidden;
    }

    .visible {
        visibility: visible;
    }
}

/* Keyframe animations */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Analytics Dropdown Styles */
.analytics-dropdown {
    @apply absolute top-full left-0 mt-1 w-64 bg-white rounded-lg shadow-lg border border-gray-200;
    @apply opacity-0 invisible transition-all duration-200 z-50;
    transform: translateY(-10px);
}

.group:hover .analytics-dropdown {
    @apply opacity-100 visible;
    transform: translateY(0);
}

.analytics-sub-tab-btn {
    @apply w-full text-left px-4 py-2 text-sm text-gray-700;
    @apply hover:bg-orange-50 hover:text-orange-600 flex items-center;
    @apply transition-colors duration-150;
}

.analytics-sub-tab-btn:hover {
    @apply transform scale-105;
}

.analytics-sub-tab-nav-btn {
    @apply px-4 py-2 text-sm font-medium rounded-md;
    @apply text-gray-500 hover:text-gray-700 hover:bg-orange-50;
    @apply transition-all duration-200;
}

.analytics-sub-tab-nav-btn.active {
    @apply bg-orange-100 text-orange-600;
    @apply shadow-sm;
}

.analytics-sub-tab-nav-btn:hover {
    @apply transform scale-105;
}

.analytics-sub-content {
    @apply transition-all duration-300 ease-in-out;
}

.analytics-sub-content.hidden {
    @apply opacity-0 max-h-0 overflow-hidden;
}

.analytics-sub-content:not(.hidden) {
    @apply opacity-100 max-h-none;
}

/* Dropdown arrow animation */
.group:hover .group svg {
    @apply transform rotate-180;
}

/* Analytics sub-tab content animations */
.analytics-sub-content {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Analytics metric cards hover effects */
.analytics-metric-card {
    @apply transition-all duration-200;
}

.analytics-metric-card:hover {
    @apply transform scale-105 shadow-lg;
}

/* Analytics navigation bar */
.analytics-nav-bar {
    @apply bg-white rounded-lg shadow-md p-4 mb-4;
    @apply border border-gray-100;
}

/* Analytics sub-tab icons */
.analytics-sub-tab-icon {
    @apply w-4 h-4 mr-2 transition-colors duration-200;
}

/* Responsive adjustments for analytics dropdown */
@media (max-width: 768px) {
    .analytics-dropdown {
        @apply w-56;
    }
    
    .analytics-sub-tab-nav-btn {
        @apply text-xs px-3 py-1.5;
    }
}
