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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* Main Content */
main {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* Editor Section */
.editor-section {
    margin-bottom: 30px;
}

.section-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.text-editor {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.text-editor:focus {
    outline: none;
    border-color: #3498db;
}

.text-info {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Analyze Button */
.analyze-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 30px;
    padding: 15px 30px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.analyze-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.analyze-button:active {
    transform: translateY(0);
}

.analyze-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner-circle {
    stroke-dasharray: 62.83;
    stroke-dashoffset: 62.83;
    animation: spinner-dash 1.5s ease-in-out infinite;
}

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

@keyframes spinner-dash {
    0% { stroke-dashoffset: 62.83; }
    50% { stroke-dashoffset: 15.71; }
    100% { stroke-dashoffset: 62.83; }
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease-in;
}

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

/* Probability Section */
.probability-section {
    margin-bottom: 40px;
}

.probability-section h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.probability-container {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.probability-circle {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.probability-circle svg {
    width: 100%;
    height: 100%;
}

.probability-arc {
    transition: stroke-dashoffset 1s ease-out, stroke 1s ease-out;
}

.probability-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.probability-value {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
}

.probability-percent {
    font-size: 1.5rem;
    color: #7f8c8d;
}

.probability-info h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.probability-description {
    font-size: 1rem;
    color: #7f8c8d;
    line-height: 1.6;
}

/* Details Section */
.details-section {
    margin-bottom: 30px;
}

.details-section h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.detected-rules {
    display: grid;
    gap: 15px;
}

.rule-item {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    border-radius: 5px;
    transition: all 0.3s;
}

.rule-item:hover {
    background: #e3f2fd;
    transform: translateX(5px);
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.rule-name {
    font-weight: 600;
    color: #2c3e50;
}

.rule-weight {
    background: #3498db;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.rule-details {
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* Score Section */
.score-section {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.score-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
}

.score-label {
    color: #7f8c8d;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3498db;
}

.score-separator {
    color: #7f8c8d;
}

.score-max {
    font-size: 1.3rem;
    color: #7f8c8d;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .probability-container {
        flex-direction: column;
        text-align: center;
    }
    
    .probability-circle {
        width: 150px;
        height: 150px;
    }
    
    .probability-value {
        font-size: 2.5rem;
    }
    
    .rule-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}