/* Tools CSS - Extends main site styling */

/* Fonts */
@font-face {
    font-family: 'Newsreader';
    src: url('/fonts/Newsreader-VariableFont_opsz_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/fonts/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

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

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #111;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header */
.site-header {
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.site-header .logo {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 20px;
    font-weight: 400;
    white-space: nowrap;
}

.site-header .main-nav {
    display: flex;
    gap: 28px;
    font-size: 14px;
    flex: 1;
    justify-content: center;
}

.site-header .main-nav a {
    color: #555;
    transition: color 0.2s;
}

.site-header .main-nav a:hover,
.site-header .main-nav a.active {
    color: #111;
}

.site-header .header-auth {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.site-header .auth-link {
    color: #555;
    transition: color 0.2s;
}

.site-header .auth-link:hover {
    color: #111;
}

.site-header .auth-btn {
    background: transparent;
    color: #333;
    padding: 7px 16px;
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.site-header .auth-btn:hover {
    border-color: #999;
    color: #111;
}

.site-header .user-menu {
    position: relative;
}

.site-header .user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.site-header .user-menu-trigger:hover {
    background: #f5f5f5;
}

.site-header .pro-badge-small {
    background: #8b2635;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.site-header .educator-badge-small {
    background: #2e7d32;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.site-header .user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    min-width: 160px;
    padding: 8px 0;
    display: none;
    z-index: 200;
}

.site-header .user-menu.open .user-dropdown {
    display: block;
}

.site-header .user-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #333;
    font-size: 14px;
    transition: background 0.2s;
}

.site-header .user-dropdown a:hover {
    background: #f5f5f5;
}

.site-header .user-dropdown .upgrade-link {
    color: #8b2635;
}

.site-header .user-dropdown .admin-link {
    color: #1565c0;
}

.site-header .user-dropdown hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #eee;
}

.site-header .mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #333;
}

/* User dropdown (used by tools-main content) */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #333;
    font-size: 14px;
    transition: background 0.2s;
}

.user-dropdown a:hover {
    background: #f5f5f5;
}

.user-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}

.user-dropdown a:last-child {
    border-radius: 0 0 8px 8px;
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 4px 0;
}

.user-dropdown .upgrade-link {
    color: #8b2635;
    font-weight: 500;
}

.user-dropdown .admin-link {
    color: #1e40af;
    font-weight: 500;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}

/* Main Content */
.tools-main {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
    width: 100%;
}

/* Footer */
.tools-footer {
    border-top: 1px solid #eee;
    padding: 32px 24px;
    background: #fafafa;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 24px;
    font-size: 14px;
}

.footer-links a {
    color: #666;
}

.footer-links a:hover {
    color: #111;
}

.footer-copyright {
    font-size: 13px;
    color: #999;
}

/* Page Layouts */
.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 8px;
}

.page-header p {
    color: #666;
    font-size: 16px;
}

/* Cards */
.card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px;
}

.card-header {
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-header p {
    font-size: 14px;
    color: #666;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.form-group .hint {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
}

.form-group.error input,
.form-group.error select {
    border-color: #dc2626;
}

.form-group .error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: #111;
    color: #fff;
}

.btn-primary:hover {
    background: #333;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e5e5e5;
}

.btn-secondary:hover {
    background: #eee;
}

.btn-full {
    width: 100%;
}

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

/* Auth Pages */
.auth-container {
    max-width: 420px;
    margin: 40px auto;
}

.auth-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 32px;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 8px;
}

.auth-header p {
    color: #666;
    font-size: 15px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.auth-footer a {
    color: #111;
    font-weight: 500;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: #999;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #eee;
}

/* Account Type Selector */
.account-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.account-type-option {
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.account-type-option:hover {
    border-color: #ccc;
}

.account-type-option.selected {
    border-color: #111;
    background: #fafafa;
}

.account-type-option h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.account-type-option p {
    font-size: 13px;
    color: #666;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .main-nav {
        display: none;
    }
    
    .site-header .header-auth {
        display: none;
    }
    
    .site-header .mobile-menu-toggle {
        display: block;
    }
    
    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .account-type-selector {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 24px;
    }
}
