/* Calculator Tools Styles - Inherits from base.html */
/* Supports both light and dark modes */

/* Tool Store Styles */
.tool-store-container {
    min-height: 100vh;
    padding-top: 100px;
    background: transparent;
}

.tool-store-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 0;
    margin-bottom: 40px;
}

[data-theme="light"] .tool-store-header {
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.store-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #ec4899, #14b8a6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.store-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

[data-theme="light"] .store-description {
    color: rgba(0, 0, 0, 0.7);
}

.user-score-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 200px;
}

[data-theme="light"] .user-score-card {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.score-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.score-info {
    display: flex;
    flex-direction: column;
}

.score-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

[data-theme="light"] .score-label {
    color: rgba(0, 0, 0, 0.6);
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fbbf24;
}

/* Tools Grid */
.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.category-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 30px;
    transition: all 0.3s ease;
}

[data-theme="light"] .category-section {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.category-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.category-header {
    margin-bottom: 30px;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

[data-theme="light"] .category-title {
    color: #1a1a1a;
}

.category-title i {
    color: #6366f1;
    font-size: 1.5rem;
}

.category-description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    font-weight: 300;
}

[data-theme="light"] .category-description {
    color: rgba(0, 0, 0, 0.6);
}

.tools-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Tool Cards */
.tool-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .tool-card {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.tool-card:hover::before {
    left: 100%;
}

.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.premium-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tool-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
}

[data-theme="light"] .tool-name {
    color: #1a1a1a;
}

.tool-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
    font-weight: 300;
}

[data-theme="light"] .tool-description {
    color: rgba(0, 0, 0, 0.7);
}

.tool-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tool-type {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 300;
}

[data-theme="light"] .tool-type {
    color: rgba(0, 0, 0, 0.6);
}

.tool-cost {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fbbf24;
    font-weight: 600;
    font-size: 1.1rem;
}

.tool-actions {
    display: flex;
    gap: 10px;
}

.tool-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.purchase-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.purchase-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    color: white;
}

.use-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.use-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    color: white;
}

.owned-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Calculator Styles */
.calculator-container {
    min-height: 100vh;
    padding: 120px 20px 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: transparent;
}

.calculator-wrapper {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    transition: all 0.3s ease;
}

[data-theme="light"] .calculator-wrapper {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .calculator-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.calculator-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
}

[data-theme="light"] .calculator-brand {
    color: #1a1a1a;
}

.calculator-brand i {
    color: #6366f1;
    font-size: 1.3rem;
}

.calculator-mode {
    display: flex;
    gap: 5px;
}

.mode-btn {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

[data-theme="light"] .mode-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.7);
}

.mode-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-color: transparent;
}

.calculator-display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: right;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

[data-theme="light"] .calculator-display {
    background: rgba(255, 255, 255, 0.9);
}

.display-expression {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    margin-bottom: 5px;
    min-height: 20px;
    word-wrap: break-word;
}

[data-theme="light"] .display-expression {
    color: rgba(0, 0, 0, 0.6);
}

.display-result {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 600;
    word-wrap: break-word;
}

[data-theme="light"] .display-result {
    color: #1a1a1a;
}

.calculator-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.button-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.calc-btn {
    aspect-ratio: 1;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.calc-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.calc-btn:hover::before {
    opacity: 1;
}

.number-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .number-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.operator-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: 1px solid transparent;
}

.function-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: 1px solid transparent;
}

.equals-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 1px solid transparent;
}

.memory-btn {
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: white;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.calc-btn:active {
    transform: scale(0.95);
}

/* Calculator History */
.calculator-history {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

[data-theme="light"] .calculator-history {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .history-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.history-header h3 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

[data-theme="light"] .history-header h3 {
    color: #1a1a1a;
}

.clear-history-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

[data-theme="light"] .history-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

[data-theme="light"] .history-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.history-expression {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

[data-theme="light"] .history-expression {
    color: rgba(0, 0, 0, 0.7);
}

.history-result {
    color: #6366f1;
    font-weight: 600;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-store-container {
        padding-top: 80px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .store-title {
        font-size: 2rem;
    }
    
    .tools-row {
        grid-template-columns: 1fr;
    }
    
    .calculator-wrapper {
        margin: 0 10px;
        padding: 20px;
    }
    
    .button-row {
        gap: 8px;
    }
    
    .calc-btn {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .calculator-container {
        padding: 100px 10px 20px;
    }
    
    .calculator-wrapper {
        padding: 15px;
    }
    
    .calc-btn {
        font-size: 0.8rem;
    }
    
    .display-result {
        font-size: 1.5rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error {
    border-color: #ef4444 !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success States */
.success {
    border-color: #10b981 !important;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

