/**
 * ConstruktorPro Template Base Styles
 * Основные стили шаблона и общие компоненты
 */

/* CSS Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;;
    line-height: 1.6;
    color: #1f2937;
    background: #ffffff;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #0d58c6;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #4c63d2;
}

img {
    max-width: 100%;
    height: auto;
}

/* Layout & Containers */
.container {
    width: 1200px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page__content {
    flex: 1;
}

/* Main Content */
.main {
    flex: 1;
}

/* Form Styles */

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

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

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* File Upload */
.file-upload {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-label:hover {
    border-color: #2563eb;
    background: #f8fafc;
}

.file-upload-label svg {
    width: 2rem;
    height: 2rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.file-upload-text {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.file-upload-hint {
    font-size: 0.875rem;
    color: #6b7280;
}

.file-upload-result {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.file-name {
    font-weight: 500;
    color: #374151;
}

.file-remove {
    float: right;
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
}

.file-remove:hover {
    background: #dc2626;
}

/* Messages */
.form-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.form-message svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.form-message--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-message--success svg {
    color: #059669;
}

.form-message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.form-message--error svg {
    color: #dc2626;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
}

.modal-close svg {
    width: 1.25rem;
    height: 1.25rem;
}

.modal-video {
    width: 100%;
    max-width: 800px;
}

.modal-video iframe {
    width: 100%;
    height: 450px;
    border: none;
    border-radius: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--primary {
    background: #2563eb;
    color: white;
}

.btn--primary:hover:not(:disabled) {
    background: #1d4ed8;
}

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

.btn--secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn--outline {
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.btn--outline:hover:not(:disabled) {
    background: #2563eb;
    color: white;
}

.btn--ghost {
    background: transparent;
    color: #6b7280;
}

.btn--ghost:hover:not(:disabled) {
    background: #f3f4f6;
    color: #374151;
}

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn--large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn--full {
    width: 100%;
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.btn--large .btn-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Validation */
.form-input.error,
.form-textarea.error,
.form-select.error {
    border-color: #dc2626;
}

.field-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Notifications - перенесены в components/notifications/notifications.css */

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Margins */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: spin 1s ease-in-out infinite;
}

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

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }

    .certificate {
        justify-content: center;
    }
    
    /* Notifications стили перенесены */
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .btn--large {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    body {
        font-size: 0.875rem;
    }
}

@media print {
    .header,
    .footer,
    .modal {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .page {
        min-height: auto;
    }
}

.academy-placeholder {
    padding: 4rem 0;
    background: #f9fafb;
}

.academy-placeholder-card {
    max-width: 640px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
    text-align: center;
}

.academy-placeholder-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.academy-placeholder-text {
    color: #4b5563;
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}
