/**
 * Thmanyah App Styles
 * 
 * @package Thmanyah
 * @author Tariq Alnajai
 * @version 1.0.0
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

/* App Container */
.thmanyah-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* App Header */
.app-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #54b974, #4a9d63);
    color: white;
    border-radius: 8px;
}

.app-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.app-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Templates Section */
.templates-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #54b974;
    font-size: 1.8rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.template-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.template-card:hover {
    border-color: #54b974;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(84, 185, 116, 0.2);
}

.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #54b974, #4a9d63);
}

.template-preview {
    margin-bottom: 20px;
}

.template-preview h3 {
    color: #54b974;
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.template-preview p {
    color: #666;
    font-size: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: #54b974;
    color: white;
}

.btn-primary:hover {
    background: #4a9d63;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* Form Section */
.form-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
}

.form-section h2 {
    text-align: center;
    color: #54b974;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

/* Steps Indicator */
.steps-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px 0;
    background: #f8f9fa;
    border-radius: 8px;
}

.step {
    display: flex;
    align-items: center;
    margin: 0 20px;
    padding: 15px 25px;
    border-radius: 25px;
    background: #e9ecef;
    color: #6c757d;
    transition: all 0.3s ease;
    position: relative;
}

.step.active {
    background: #54b974;
    color: white;
    transform: scale(1.05);
}

.step.completed {
    background: #28a745;
    color: white;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    color: #54b974;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-left: 10px;
    font-size: 0.9rem;
}

.step.active .step-number {
    background: white;
    color: #54b974;
}

.step.completed .step-number {
    background: white;
    color: #28a745;
}

.step-title {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Form Content */
.form-content {
    margin-bottom: 30px;
}

.form-content h3 {
    color: #54b974;
    margin-bottom: 25px;
    font-size: 1.4rem;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #54b974;
    box-shadow: 0 0 0 3px rgba(84, 185, 116, 0.1);
}

.form-field input.error,
.form-field select.error,
.form-field textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-field textarea {
    min-height: 100px;
    resize: vertical;
}

/* Radio Buttons */
.radio-label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.radio-label:hover {
    background: #f8f9fa;
}

.radio-label input[type="radio"] {
    margin-left: 10px;
    width: 18px;
    height: 18px;
}

.radio-label input[type="radio"]:checked + span {
    color: #54b974;
    font-weight: 500;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

/* Messages */
.message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .thmanyah-app {
        margin: 10px;
        padding: 15px;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .app-header p {
        font-size: 1rem;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .steps-indicator {
        flex-direction: column;
        gap: 10px;
    }
    
    .step {
        margin: 0;
        padding: 10px 15px;
    }
    
    .form-fields {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 20px 0;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    .template-card {
        padding: 20px;
    }
    
    .form-section {
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    .thmanyah-app {
        box-shadow: none;
        border: none;
    }
    
    .form-actions,
    .steps-indicator {
        display: none;
    }
    
    .form-content {
        margin-bottom: 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e9ecef;
    }
    
    .thmanyah-app {
        background: #2d2d2d;
        color: #e9ecef;
    }
    
    .template-card {
        background: #3d3d3d;
        border-color: #4d4d4d;
    }
    
    .form-field input,
    .form-field select,
    .form-field textarea {
        background: #3d3d3d;
        border-color: #4d4d4d;
        color: #e9ecef;
    }
    
    .form-field input:focus,
    .form-field select:focus,
    .form-field textarea:focus {
        border-color: #54b974;
    }
}
