/* My Orders Page Styles */

/* Safe area handling for mobile devices */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Header Styles */
.my-orders-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Order Card Styles */
.order-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.order-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.order-card.expired {
    opacity: 0.6;
    background: #f9fafb;
}

.order-card.active {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Order Status Badge */
.order-status {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.order-status.active {
    background: #d1fae5;
    color: #059669;
}

.order-status.expired {
    background: #fee2e2;
    color: #dc2626;
}

/* Today Trade Badge */
.order-today-trade-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
    border: 1px solid #f59e0b;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
    }
    50% {
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    }
}

.order-today-trade-badge i {
    font-size: 0.7rem;
}

/* Order Info Grid */
.order-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .order-info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.order-info-item {
    display: flex;
    flex-direction: column;
}

.order-info-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.order-info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

/* Action Buttons */
.order-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.action-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.action-btn.primary:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal Styles */
#order-detail-modal {
    backdrop-filter: blur(4px);
}

/* Tab Styles */
.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.tab-btn:hover {
    color: #3b82f6;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-content {
    min-height: 200px;
}

/* Trade Item Styles */
.trade-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.trade-item:hover {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.trade-stock {
    font-weight: 700;
    font-size: 1rem;
    color: #111827;
}

.trade-code {
    font-size: 0.875rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

/* Trade Type Styles */
.trade-type {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.trade-type.buy {
    background-color: #d1fae5;
    color: #059669;
    border: 1px solid #10b981;
}

.trade-type.sell {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #ef4444;
}

.trade-price-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trade-price-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.trade-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #3b82f6;
}

.trade-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Today Trade Item Styles */
.trade-item-today {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
    position: relative;
}

.trade-item-today:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.trade-item-today .today-badge {
    position: absolute;
    top: -0.5rem;
    right: 0.75rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    display: flex;
    align-items: center;
    z-index: 1;
}

.trade-item-today .trade-price {
    color: #d97706;
    font-weight: 800;
}

/* Trades Section Styles */
.trades-section {
    margin-bottom: 2rem;
}

.trades-section:last-child {
    margin-bottom: 0;
}

.section-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.today-section .section-header {
    border-bottom-color: #f59e0b;
}

.history-section .section-header {
    border-bottom-color: #e5e7eb;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
}

.today-section .section-title {
    color: #d97706;
}

.history-section .section-title {
    color: #6b7280;
}

.section-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Position Item Styles */
.position-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.position-item:hover {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.position-stock {
    font-weight: 700;
    font-size: 1rem;
    color: #111827;
}

.position-code {
    font-size: 0.875rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

.position-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Order Info Section */
.order-info-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.order-info-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.order-info-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.order-info-detail-item {
    display: flex;
    flex-direction: column;
}

.order-info-detail-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.order-info-detail-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

/* Responsive Design */
@media (max-width: 640px) {
    .order-info-grid {
        grid-template-columns: 1fr;
    }
    
    .order-info-detail {
        grid-template-columns: 1fr;
    }
    
    .order-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    #order-detail-modal .bg-white {
        max-height: 95vh;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar Styles */
#my-orders-container::-webkit-scrollbar {
    width: 6px;
}

#my-orders-container::-webkit-scrollbar-track {
    background: transparent;
}

#my-orders-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#my-orders-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Empty State Styles */
#empty-state {
    animation: fadeIn 0.3s ease-out;
}
