/* Modern Registration Interface CSS */

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Modern color palette */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4CAF50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --background-light: #f8f9fa;
    --background-white: #ffffff;
    --border-color: #e1e8ed;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 30px rgba(0,0,0,0.2);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modern body styling */
body.modern-register {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container for the registration form */
.modern-register-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Animated background elements */
.modern-register-container::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="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="50" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="30" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

/* Main registration card */
.modern-register-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
    position: relative;
    z-index: 1;
}

/* Left side - Registration form */
.register-form-section {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Right side - Login form */
.login-form-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    position: relative;
}

.login-form-section::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"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="60" cy="30" r="1" fill="rgba(255,255,255,0.05)"/></svg>');
    pointer-events: none;
}

/* Form headers */
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form-section .form-header h2,
.login-form-section .form-header p {
    color: white;
    -webkit-text-fill-color: white;
}

/* Form groups */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.login-form-section .form-group label {
    color: rgba(255, 255, 255, 0.9);
}

/* Modern input styling */
.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background: var(--background-white);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.login-form-section .form-input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.login-form-section .form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.login-form-section .form-input:focus {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Captcha container */
.captcha-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-container .form-input {
    flex: 1;
}

.captcha-image {
    border-radius: 6px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.captcha-image:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

/* Modern button styling */
.btn-modern {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Loading state */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Links */
.form-links {
    text-align: center;
    margin-top: 20px;
}

.form-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    display: block;
    margin: 8px 0;
}

.form-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.login-form-section .form-link {
    color: rgba(255, 255, 255, 0.9);
}

.login-form-section .form-link:hover {
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .modern-register-card {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 20px;
    }
    
    .register-form-section,
    .login-form-section {
        padding: 30px 20px;
    }
    
    .form-header h2 {
        font-size: 24px;
    }
}

/* Error and success states */
.form-group.error .form-input {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.form-group.success .form-input {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.error-message {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.success-message {
    color: var(--success-color);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Database connection error overlay */
.db-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.db-error-message {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 400px;
    margin: 20px;
    box-shadow: var(--shadow-heavy);
}

.db-error-message h3 {
    color: var(--warning-color);
    margin-bottom: 15px;
    font-size: 20px;
}

.db-error-message p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out 0.2s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--background-white);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: var(--shadow-medium);
    border-left: 4px solid var(--primary-color);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 400px;
}

.notification-success {
    border-left-color: var(--success-color);
}

.notification-error {
    border-left-color: var(--error-color);
}

.notification-warning {
    border-left-color: var(--warning-color);
}

.notification button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    margin-left: 10px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification button:hover {
    color: var(--text-primary);
}

/* Focus states */
.form-group.focused .form-input {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* Captcha refresh animation */
.captcha-image.refreshing {
    opacity: 0.5;
    transform: rotate(180deg);
}

/* Button hover states */
.btn-modern.hovered {
    transform: translateY(-1px);
}

/* Additional responsive improvements */
@media (max-width: 480px) {
    .modern-register-container {
        padding: 10px;
    }

    .register-form-section,
    .login-form-section {
        padding: 20px 15px;
    }

    .form-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .btn-modern {
        padding: 14px 20px;
    }

    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}
