/* ContatosPro - Modern Apple Human Interface Guidelines */

:root {
    /* Brand Colors */
    --primary: #007AFF;
    --primary-hover: #0051D5;
    --primary-light: rgba(0, 122, 255, 0.1);
    
    /* Semantic Colors */
    --success: #34C759;
    --success-hover: #2DA84E;
    --success-light: rgba(52, 199, 89, 0.12);
    
    --danger: #FF3B30;
    --danger-hover: #D63028;
    --danger-light: rgba(255, 59, 48, 0.12);
    
    --warning: #FF9500;
    --warning-light: rgba(255, 149, 0, 0.12);

    /* Neutrals */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F2F2F7;
    --gray-200: #E5E5EA;
    --gray-300: #D1D1D6;
    --gray-400: #C7C7CC;
    --gray-500: #8E8E93;
    --gray-600: #636366;
    --gray-700: #48484A;
    --gray-800: #3A3A3C;
    --gray-900: #1C1C1E;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-colored: 0 10px 25px -5px var(--shadow-color);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    font-size: 15px; /* iOS standard base size */
}

a {
    transition: all 0.2s ease;
}

/* Utilities */
.apple-body {
    background-color: var(--gray-50);
    min-height: 100vh;
}

/* Header */
.apple-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
    height: 64px;
}

/* Typography */
.apple-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--gray-900);
}

.apple-subtitle {
    font-size: 17px;
    color: var(--gray-500);
    font-weight: 400;
}

.apple-heading {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--gray-900);
}

.apple-text-sm {
    font-size: 14px;
    color: var(--gray-600);
}

.apple-text-xs {
    font-size: 12px;
    color: var(--gray-500);
}

.apple-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.apple-link:hover {
    color: var(--primary-hover);
}

/* Cards */
.apple-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.apple-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(0,0,0,0.08); /* slightly darker border on hover */
}

/* Stat Cards */
.apple-stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease;
}

.apple-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.apple-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.apple-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

/* Buttons */
.apple-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.2);
}

.apple-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 122, 255, 0.3);
}

.apple-button:active {
    transform: translateY(0);
}

.apple-button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--gray-100);
    color: var(--gray-900);
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apple-button-secondary:hover {
    background: var(--gray-200);
    color: black;
}

.apple-button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: var(--danger-light);
    color: var(--danger);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apple-button-danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Inputs */
.apple-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.apple-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--gray-900);
    transition: all 0.2s ease;
}

.apple-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.apple-input::placeholder {
    color: var(--gray-400);
}

/* Badges */
[class^="apple-badge-"] {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.apple-badge-success {
    background: var(--success-light);
    color: var(--success);
}

.apple-badge-error {
    background: var(--danger-light);
    color: var(--danger);
}

.apple-badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* Tables */
.apple-table-th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-200);
}

.apple-table-td {
    padding: 16px;
    font-size: 14px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.apple-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 16px;
}

/* Modal */
.apple-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.apple-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.apple-modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.apple-modal:not(.hidden) .apple-modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Alerts */
.apple-alert-success, .apple-alert-error {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.apple-alert-success {
    background: var(--success-light);
    color: var(--success-hover);
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.apple-alert-error {
    background: var(--danger-light);
    color: var(--danger-hover);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

/* Logo Circle */
.apple-logo-circle {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 122, 255, 0.25);
    color: white;
}

/* Responsive */
@media (max-width: 640px) {
    .apple-card {
        padding: 20px;
    }
    .apple-stat-card {
        padding: 16px;
    }
    .apple-title {
        font-size: 24px;
    }
}
