/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #667eea;
}

.logo i {
    font-size: 2rem;
    color: #764ba2;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    font-weight: 500;
    font-size: 0.9rem;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.4);
}

@media (max-width: 768px) {
    .header-content {
        padding: 0.75rem 0;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }

    
    .logout-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Messages */
.messages-container {
    position: fixed;
    top: 80px;
    left: 1rem;
    right: 1rem;
    z-index: 1001;
}

.message {
    margin-bottom: 0.5rem;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
}

.message-error {
    background: rgba(254, 202, 202, 0.95);
    border-left: 4px solid #f56565;
    color: #c53030;
}

.message-success {
    background: rgba(198, 246, 213, 0.95);
    border-left: 4px solid #48bb78;
    color: #276749;
}

.message-info {
    background: rgba(190, 227, 248, 0.95);
    border-left: 4px solid #4299e1;
    color: #2b6cb0;
}

.message-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-right: auto;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.message-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .messages-container {
        top: 70px;
        left: 0.75rem;
        right: 0.75rem;
    }
    
    .message {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
    min-height: calc(100vh - 180px);
}

@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem 0;
    }
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.card-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.card-header .subtitle {
    margin-top: 0.5rem;
    opacity: 0.9;
    font-size: 0.9rem;
}

.card-body {
    padding: 2rem;
}

@media (max-width: 768px) {
    .card-header {
        padding: 1.25rem;
    }
    
    .card-header h2 {
        font-size: 1.25rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #ffffff;
    font-size: 0.9rem;
}

.form-label.required::after {
    content: " *";
    color: #e53e3e;
    font-weight: bold;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.625rem 0.875rem;
        font-size: 0.95rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #a0aec0, #718096);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(160, 174, 192, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .btn-group {
        gap: 0.75rem;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Checkboxes and Radios */
.checkbox-group,
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-item:hover,
.radio-item:hover {
    background: #edf2f7;
}

.checkbox-item input,
.radio-item input {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

@media (max-width: 768px) {
    .checkbox-group,
    .radio-group {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .checkbox-item,
    .radio-item {
        padding: 0.625rem;
        font-size: 0.9rem;
    }
}

/* Progress Steps */
.steps-container {
    margin-bottom: 2rem;
}

.steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 1rem;
}

.steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    z-index: 2;
    padding: 0.5rem;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step-number.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.step-number.completed {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
}

.step-number:not(.active):not(.completed) {
    background: #e2e8f0;
    color: #a0aec0;
}

.step-title {
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    color: #4a5568;
}

@media (max-width: 768px) {
    .steps {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .step {
        min-width: 80px;
        padding: 0.25rem;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .step-title {
        font-size: 0.7rem;
        white-space: nowrap;
    }
}

/* Footer */
.footer {
    background: rgba(45, 55, 72, 0.95);
    backdrop-filter: blur(10px);
    color: #a0aec0;
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #a0aec0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #667eea;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-links {
        gap: 1rem;
    }
    
    .footer-links a {
        font-size: 0.85rem;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .card {
        background: rgba(45, 55, 72, 0.95);
        color: #e2e8f0;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        background: rgba(74, 85, 104, 0.8);
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .checkbox-item,
    .radio-item {
        background: rgba(74, 85, 104, 0.5);
    }
    
    .checkbox-item:hover,
    .radio-item:hover {
        background: rgba(74, 85, 104, 0.7);
    }
}