/* Custom Styles and Animations */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Mode Buttons */
.mode-btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn.active {
    border-color: #6366f1 !important;
    background-color: #eef2ff !important;
}

.mode-btn.active h3 {
    color: #6366f1 !important;
}

/* Method Buttons */
.method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 2px solid #d1d5db;
    border-radius: 0.75rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.method-btn:hover {
    background-color: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.method-btn.active {
    border-color: #6366f1;
    background-color: #eef2ff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Transaction Item */
.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: white;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.transaction-item:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.transaction-item.purchase {
    border-left: 4px solid #10b981;
}

.transaction-item.sale {
    border-left: 4px solid #f59e0b;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Inventory Layer */
.inventory-layer {
    position: relative;
    padding: 1rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    animation: fadeIn 0.5s ease;
    overflow: hidden;
}

.inventory-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.1) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    opacity: 0.3;
}

.inventory-layer:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.inventory-layer:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.inventory-layer:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.inventory-layer:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.inventory-layer:nth-child(5) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.inventory-layer:nth-child(n+6) {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Layer Box Animation */
.layer-box {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin: 2px;
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Quiz Option */
.quiz-option {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    border-color: #6366f1;
    background-color: #f9fafb;
    transform: translateX(5px);
}

.quiz-option.selected {
    border-color: #6366f1;
    background-color: #eef2ff;
}

.quiz-option.correct {
    border-color: #10b981;
    background-color: #d1fae5;
}

.quiz-option.incorrect {
    border-color: #ef4444;
    background-color: #fee2e2;
}

/* Success/Error Messages */
.success-message {
    background-color: #d1fae5;
    border: 2px solid #10b981;
    color: #065f46;
}

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

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

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

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4f46e5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .layer-box {
        width: 30px;
        height: 30px;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
}

/* Accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Calculation Breakdown Styles */
.calculation-line {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calculation-line:last-child {
    border-bottom: none;
}

/* Result Cards Animation */
.result-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Can add dark mode styles here if needed */
}
