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

body {
    font-family: 'Inter', 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    direction: rtl;
    color: #333;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #fff, #e3f2fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.input-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1), 0 0 0 1px rgba(255,255,255,0.1);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.input-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.2);
}

.input-group {
    display: flex;
    gap: 20px;
    align-items: center;
    position: relative;
    margin-bottom: 25px;
}

.quick-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.history-link, .dashboard-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.dashboard-link {
    background: linear-gradient(135deg, #17a2b8, #138496);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.history-link:hover, .dashboard-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.dashboard-link:hover {
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

#domain {
    flex: 1;
    padding: 20px 25px;
    border: 2px solid #e1e8f0;
    border-radius: 15px;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    color: #333;
    font-weight: 500;
}

#domain:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

#domain::placeholder {
    color: #aaa;
    font-weight: 400;
}

#analyzeBtn {
    padding: 20px 35px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

#analyzeBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #764ba2, #667eea);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#analyzeBtn:hover::before {
    opacity: 1;
}

#analyzeBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

#analyzeBtn:active {
    transform: translateY(-1px);
}

#analyzeBtn span {
    position: relative;
    z-index: 1;
}

#analyzeBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loader {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    position: relative;
}

.loader::before,
.loader::after {
    content: '';
    position: absolute;
    border: 4px solid transparent;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.loader::before {
    width: 60px;
    height: 60px;
}

.loader::after {
    width: 40px;
    height: 40px;
    top: 10px;
    left: 10px;
    border-top-color: #764ba2;
    animation-duration: 0.8s;
    animation-direction: reverse;
}

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

.loading p {
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 500;
}

.results {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.score-overview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    color: white;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    position: relative;
    overflow: hidden;
}

.score-overview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.total-score {
    text-align: center;
    position: relative;
    z-index: 1;
}

.total-score h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
    opacity: 0.9;
}

.score-circle {
    width: 140px;
    height: 140px;
    border: 6px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 0 auto;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.score-circle::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #fff 0deg, #fff var(--score-angle, 0deg), transparent var(--score-angle, 0deg));
    z-index: -1;
    opacity: 0.6;
}

.score-circle span {
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.score-circle small {
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 500;
}

.sub-scores {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.score-item {
    min-width: 220px;
}

.score-item h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.95;
}

.score-bar {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    position: relative;
    margin-bottom: 8px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #fff, #e3f2fd);
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.score-item span {
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.analysis-details {
    padding: 0;
}

.tab-navigation {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e8f0;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 20px 25px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    color: #666;
    white-space: nowrap;
    position: relative;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-btn span {
    position: relative;
    z-index: 1;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
    box-shadow: 0 -3px 10px rgba(102, 126, 234, 0.1);
}

.tab-content {
    display: none;
    padding: 40px;
    background: white;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

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

.tab-content h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 25px;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

.tab-content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.check-list {
    display: grid;
    gap: 20px;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    background: #fff;
    border-radius: 15px;
    border-right: 4px solid #e1e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.check-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(102, 126, 234, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.check-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.check-item:hover::before {
    opacity: 1;
}

.check-item.pass {
    border-right-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #d1ecf1);
}

.check-item.fail {
    border-right-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.check-item.warning {
    border-right-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.check-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.check-item.pass .check-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.check-item.fail .check-icon {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.check-item.warning .check-icon {
    background: linear-gradient(135deg, #ffc107, #f39c12);
    color: #333;
}

.check-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.check-title {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: #333;
}

.check-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.check-solution {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 10px;
    border-right: 3px solid #667eea;
    margin-top: 10px;
}

.check-solution h4 {
    color: #667eea;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.check-solution p {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

.suggestions-list {
    display: grid;
    gap: 25px;
}

.suggestion-item {
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border-radius: 15px;
    border-right: 4px solid #667eea;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.suggestion-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(102, 126, 234, 0.03));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.suggestion-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.suggestion-item:hover::before {
    opacity: 1;
}

.suggestion-title {
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

.suggestion-description {
    color: #666;
    line-height: 1.7;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.suggestion-priority {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.priority-high {
    background: #dc3545;
    color: white;
}

.priority-medium {
    background: #ffc107;
    color: #333;
}

.priority-low {
    background: #28a745;
    color: white;
}

.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #f5c6cb;
    text-align: center;
    box-shadow: 0 5px 20px rgba(220, 53, 69, 0.2);
}

.progress-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.progress-step {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e1e8f0;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: #667eea;
    transform: scale(1.2);
}

.progress-step.completed {
    background: #28a745;
}

@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .score-overview {
        flex-direction: column;
        text-align: center;
        padding: 30px;
    }
    
    .sub-scores {
        justify-content: center;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 15px;
    }
    
    #domain, #analyzeBtn {
        width: 100%;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-circle span {
        font-size: 2.5rem;
    }
    
    .sub-scores {
        flex-direction: column;
        gap: 20px;
    }
    
    .score-item {
        min-width: auto;
    }
    
    .tab-navigation {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        min-width: 120px;
        flex: none;
    }
    
    .tab-content {
        padding: 25px;
    }
    
    .check-item {
        padding: 20px;
        gap: 15px;
    }
    
    .check-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .input-section {
        padding: 25px;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .history-link, .dashboard-link {
        width: 100%;
        justify-content: center;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .check-item {
        padding: 15px;
        gap: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .check-icon {
        margin: 0 auto;
    }
    
    .suggestion-item {
        padding: 20px;
    }
    
    .score-overview {
        padding: 20px;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-circle span {
        font-size: 2rem;
    }
    
    .sub-scores {
        width: 100%;
    }
    
    .score-item {
        width: 100%;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
}