
/* Calcular Potencia - Power Calculator Styles */

.calcular-potencia-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.calcular-potencia-wrapper[data-theme="light"] {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.calcular-potencia-container {
    background: #2d3748;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.calcular-potencia-wrapper[data-theme="light"] .calcular-potencia-container {
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Header */
.cp-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);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.cp-title {
    margin: 0;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-title {
    color: #2d3748;
    text-shadow: none;
}

.cp-controls {
    display: flex;
    gap: 10px;
}

.cp-btn-theme {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cp-btn-theme:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-btn-theme {
    background: rgba(0, 0, 0, 0.05);
    color: #2d3748;
}

.calcular-potencia-wrapper[data-theme="light"] .cp-btn-theme:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Display Screen */
.cp-screen {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.3);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-screen {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.cp-display {
    width: 100%;
    background: transparent;
    border: none;
    color: #4ade80;
    font-size: 36px;
    font-weight: 600;
    text-align: right;
    outline: none;
    margin-bottom: 10px;
    font-family: "Monaco", "Menlo", monospace;
    word-break: break-all;
    min-height: 40px;
}

.calcular-potencia-wrapper[data-theme="light"] .cp-display {
    color: #2d3748;
}

.cp-previous-operand {
    text-align: right;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    min-height: 18px;
}

.calcular-potencia-wrapper[data-theme="light"] .cp-previous-operand {
    color: rgba(0, 0, 0, 0.6);
}

/* Memory Indicator */
.cp-memory-indicator {
    text-align: right;
    margin-bottom: 15px;
    font-size: 12px;
    color: #f59e0b;
    font-weight: 500;
}

.cp-memory-label:empty {
    display: none;
}

/* Keypad */
.cp-keypad {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.cp-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

/* Buttons */
.cp-btn {
    padding: 15px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cp-btn:active {
    transform: scale(0.95);
}

/* Number buttons */
.cp-btn-number {
    background: #4b5563;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cp-btn-number:hover {
    background: #5a6577;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-btn-number {
    background: #e2e8f0;
    color: #2d3748;
    border-color: rgba(0, 0, 0, 0.05);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-btn-number:hover {
    background: #cbd5e0;
}

/* Function buttons */
.cp-btn-function {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cp-btn-function:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-btn-function {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Operation buttons */
.cp-btn-operation {
    background: #f59e0b;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 700;
    font-size: 16px;
}

.cp-btn-operation:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

/* Clear buttons */
.cp-btn-clear {
    background: #ef4444;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cp-btn-clear:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

/* Memory buttons */
.cp-btn-memory {
    background: #10b981;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 12px;
}

.cp-btn-memory:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Tall buttons for layout balance */
.cp-btn.tall {
    grid-row: span 2;
}

/* Angle Mode Selector */
.cp-angle-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 13px;
    color: #fff;
}

.calcular-potencia-wrapper[data-theme="light"] .cp-angle-mode {
    background: rgba(0, 0, 0, 0.05);
    color: #2d3748;
}

#cp-angle-mode {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#cp-angle-mode:hover {
    background: rgba(255, 255, 255, 0.15);
}

#cp-angle-mode:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
}

#cp-angle-mode option {
    background: #2d3748;
    color: #fff;
}

.calcular-potencia-wrapper[data-theme="light"] #cp-angle-mode {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #2d3748;
}

.calcular-potencia-wrapper[data-theme="light"] #cp-angle-mode:hover {
    background: rgba(0, 0, 0, 0.1);
}

.calcular-potencia-wrapper[data-theme="light"] #cp-angle-mode:focus {
    background: rgba(0, 0, 0, 0.15);
}

.calcular-potencia-wrapper[data-theme="light"] #cp-angle-mode option {
    background: #ffffff;
    color: #2d3748;
}

/* History Section */
.cp-history-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 15px;
    max-height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-history-section {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

.cp-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-history-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.cp-history-header h4 {
    margin: 0;
    color: #fff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calcular-potencia-wrapper[data-theme="light"] .cp-history-header h4 {
    color: #2d3748;
}

.cp-btn-history-clear {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    padding: 0;
}

.cp-btn-history-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.calcular-potencia-wrapper[data-theme="light"] .cp-btn-history-clear {
    border-color: rgba(0, 0, 0, 0.2);
    color: #2d3748;
}

.calcular-potencia-wrapper[data-theme="light"] .cp-btn-history-clear:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: #2d3748;
}

.cp-history-list {
    overflow-y: auto;
    max-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cp-history-item {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Monaco", "Menlo", monospace;
    border: 1px solid transparent;
}

.cp-history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-history-item {
    background: rgba(0, 0, 0, 0.05);
    color: #2d3748;
}

.calcular-potencia-wrapper[data-theme="light"] .cp-history-item:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.cp-history-item-operation {
    color: #4ade80;
    font-weight: 600;
}

.calcular-potencia-wrapper[data-theme="light"] .cp-history-item-operation {
    color: #059669;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .calcular-potencia-wrapper {
        padding: 10px;
        margin: 10px auto;
    }

    .calcular-potencia-container {
        padding: 15px;
    }

    .cp-title {
        font-size: 18px;
    }

    .cp-display {
        font-size: 28px;
    }

    .cp-row {
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
    }

    .cp-btn {
        padding: 12px;
        font-size: 12px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

    .cp-history-section {
        max-height: 150px;
    }

    .cp-history-list {
        max-height: 120px;
    }
}

@media (max-width: 480px) {
    .calcular-potencia-wrapper {
        padding: 8px;
    }

    .calcular-potencia-container {
        padding: 12px;
    }

    .cp-header {
        margin-bottom: 15px;
    }

    .cp-title {
        font-size: 16px;
    }

    .cp-display {
        font-size: 24px;
        padding: 15px;
    }

    .cp-screen {
        padding: 15px;
        margin-bottom: 15px;
    }

    .cp-row {
        gap: 5px;
    }

    .cp-btn {
        padding: 10px;
        font-size: 11px;
    }

    .cp-angle-mode {
        flex-direction: column;
        gap: 8px;
        font-size: 12px;
    }

    #cp-angle-mode {
        width: 100%;
        padding: 8px;
    }
}

/* Scrollbar styling for history */
.cp-history-list::-webkit-scrollbar {
    width: 6px;
}

.cp-history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.cp-history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.cp-history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-history-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

.calcular-potencia-wrapper[data-theme="light"] .cp-history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cp-history-item {
    animation: slideIn 0.3s ease;
}

/* Accessibility */
.cp-btn:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.cp-display:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
