/* Splitorium Web - Minimal Functional Styles */

/* CSS Variables */
:root {
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --error-color: #f44336;
    --success-color: #4CAF50;
    --warning-color: #ff9800;
    --text-color: #333;
    --text-muted: #666;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --border-color: #ddd;
    --border-radius: 8px;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-store-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
    padding-right: 1rem;
    border-right: 1px solid var(--border-color);
}

.header-store-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    background: #000;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.2s;
}

.header-store-badge:hover {
    background: #333;
    transform: translateY(-1px);
}

.header-store-badge .store-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: var(--bg-color);
}

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

/* Footer */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1rem;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 1rem;
}

.footer-links a:hover {
    color: var(--text-color);
}

.app-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.app-links-label {
    color: var(--text-muted);
}

.app-store-link img {
    height: 40px;
    opacity: 0.7;
}

.app-store-link:hover img {
    opacity: 1;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.copyright a,
.footer-company-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

.copyright a:hover,
.footer-company-link:hover {
    color: var(--primary-color);
}

.footer-brand {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0.5rem 0 0 0;
}

.footer-brand a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer-brand a:hover {
    text-decoration: underline;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* Auth Forms */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.auth-title {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.form-group {
    margin-bottom: 1rem;
}

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

.form-label .required {
    color: var(--error-color);
    margin-left: 2px;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-input.error {
    border-color: var(--error-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #ffebee;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.alert-success {
    background-color: #e8f5e9;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.alert-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #1976d2;
}

/* Links */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Loading State */
.loading {
    display: none;
    text-align: center;
    padding: 1rem;
}

.loading.active {
    display: block;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Dashboard */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-welcome {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: var(--text-muted);
}

/* Friends List */
.friends-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.friend-item:last-child {
    border-bottom: none;
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.friend-name {
    font-weight: 500;
}

.friend-username {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.friend-status {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-accepted {
    background: #e8f5e9;
    color: var(--success-color);
}

.status-pending {
    background: #fff3e0;
    color: var(--warning-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Phone Input with Country Code */
.phone-input-group {
    display: flex;
    gap: 0.5rem;
}

.country-code-select {
    width: 110px;
    flex-shrink: 0;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.country-code-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.phone-number-input {
    flex: 1;
}

/* Validation Feedback */
.form-input.valid {
    border-color: var(--success-color);
}

.form-input.invalid {
    border-color: var(--error-color);
}

.country-code-select.valid {
    border-color: var(--success-color);
}

.country-code-select.invalid {
    border-color: var(--error-color);
}

.validation-message {
    font-size: 0.8rem;
    margin-top: 0.35rem;
    min-height: 1.2rem;
}

.validation-message.error {
    color: var(--error-color);
}

.validation-message.success {
    color: var(--success-color);
}

.validation-message.hint {
    color: var(--text-muted);
}

/* Password Requirements */
.password-requirements {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0 0 0;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.2rem;
}

.password-requirements li::before {
    content: '○';
    color: var(--text-muted);
}

.password-requirements li.valid::before {
    content: '✓';
    color: var(--success-color);
}

.password-requirements li.invalid::before {
    content: '✗';
    color: var(--error-color);
}

/* Form Helper Text */
.form-helper {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Disabled button state */
.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Verification Code Input */
.code-input {
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5rem;
    font-family: monospace;
}

/* SSO Buttons */
.sso-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.sso-button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Apple Sign-In Button */
.apple-btn {
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 0.75rem 1rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.apple-btn:hover {
    background-color: #333;
}

.apple-btn .apple-logo {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.apple-btn span {
    white-space: nowrap;
}

/* Google Sign-In Button container */
.google-btn {
    display: flex;
    justify-content: center;
}

/* Make Google button full width */
.google-btn > div {
    width: 100% !important;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-store-links {
        display: none;
    }
}

@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .auth-container {
        margin: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .app-links {
        flex-direction: column;
    }
}

