/**
 * Sqrt Calculator Pro Styles
 * Protected Version
 */

 .sqrt-calculator-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
}

.sqrt-calc-wrapper {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    animation: fadeIn 0.5s ease-out;
}

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

.sqrt-calc-title {
    text-align: center;
    color: #333;
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.sqrt-calc-subtitle {
    text-align: center;
    color: #666;
    margin: 0 0 25px 0;
    font-size: 14px;
}

.sqrt-calc-formula {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 25px;
    border: 2px solid #667eea20;
}

.sqrt-calc-formula span {
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

.sqrt-calc-main {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.sqrt-input-group {
    margin-bottom: 20px;
}

.sqrt-input-group label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-weight: 500;
    font-size: 15px;
}

.sqrt-input-wrapper {
    display: flex;
    gap: 10px;
}

#sqrt-number {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

#sqrt-number:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sqrt-btn-calculate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.sqrt-btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.sqrt-btn-calculate:active {
    transform: translateY(0);
}

.sqrt-precision-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sqrt-precision-control label {
    margin: 0;
    color: #555;
    font-weight: 500;
}

#sqrt-precision {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s;
}

#sqrt-precision:focus {
    outline: none;
    border-color: #667eea;
}

.sqrt-btn-reset {
    padding: 8px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.sqrt-btn-reset:hover {
    background: #5a6268;
}

.sqrt-quick-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.sqrt-quick-buttons button {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.sqrt-quick-buttons button:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

.sqrt-result-section {
    min-height: 80px;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s;
}

.sqrt-result-section.show {
    opacity: 1;
    transform: scale(1);
}

.sqrt-result-wrapper {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #667eea20;
}

.sqrt-result-info {
    background: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.sqrt-result-value {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    margin: 15px 0;
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.sqrt-result-formula {
    text-align: center;
    color: #666;
    font-size: 18px;
    margin: 10px 0;
}

.sqrt-result-verify {
    background: #e8f4f8;
    padding: 10px;
    border-radius: 8px;
    color: #555;
    font-size: 13px;
    margin-top: 15px;
}

.sqrt-error {
    color: #e74c3c;
    font-size: 16px;
    text-align: center;
    padding: 20px;
    background: #ffe6e6;
    border-radius: 10px;
    border: 1px solid #ffcccc;
}

.sqrt-history-section {
    margin-top: 30px;
}

.sqrt-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sqrt-history-header span {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.sqrt-btn-clear {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.sqrt-btn-clear:hover {
    background: #c0392b;
}

.sqrt-history-list {
    max-height: 250px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
}

.sqrt-history-item {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e0e0e0;
    animation: slideInLeft 0.3s ease-out;
}

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

.sqrt-history-item strong {
    color: #667eea;
    font-weight: 600;
}

.sqrt-time {
    color: #999;
    font-size: 12px;
}

.sqrt-empty-history {
    text-align: center;
    color: #999;
    padding: 30px;
    font-style: italic;
}

.sqrt-tips-section {
    margin-top: 25px;
    background: #fff3cd;
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #ffc107;
}

.sqrt-tips-title {
    color: #856404;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 15px;
}

.sqrt-tips-content {
    color: #856404;
    font-size: 13px;
    line-height: 1.8;
}

/* Dark theme support */
.sqrt-calculator-container[data-theme="dark"] .sqrt-calc-wrapper {
    background: #2c3e50;
    color: #ecf0f1;
}

.sqrt-calculator-container[data-theme="dark"] .sqrt-calc-main {
    background: #34495e;
}

.sqrt-calculator-container[data-theme="dark"] .sqrt-calc-title,
.sqrt-calculator-container[data-theme="dark"] .sqrt-calc-formula span,
.sqrt-calculator-container[data-theme="dark"] label {
    color: #ecf0f1;
}

/* Responsive design */
@media (max-width: 600px) {
    .sqrt-calc-wrapper {
        padding: 20px;
    }
    
    .sqrt-calc-title {
        font-size: 24px;
    }
    
    .sqrt-result-value {
        font-size: 28px;
    }
    
    .sqrt-input-wrapper {
        flex-direction: column;
    }
    
    .sqrt-btn-calculate {
        width: 100%;
    }
}

/* Print protection */
@media print {
    .sqrt-calculator-container {
        display: none !important;
    }
}

/* Additional security styles */
.sqrt-calculator-container * {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

.sqrt-calculator-container input,
.sqrt-calculator-container textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Hide source code watermark */
.sqrt-calculator-container::before {
    content: "© Protected Calculator";
    position: absolute;
    font-size: 1px;
    color: transparent;
    z-index: -1;
}