/* Apple-Style Theme CSS */
/* This file contains additional Apple-style utilities and components */

/* Apple-style form inputs */
.apple-input {
    background: var(--apple-bg-primary);
    border: 1px solid var(--apple-separator);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--apple-text-primary);
    transition: all 0.2s ease;
}

.apple-input:focus {
    outline: none;
    border-color: var(--apple-system-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.apple-input::placeholder {
    color: var(--apple-text-tertiary);
}

/* Apple-style select */
.apple-select {
    background: var(--apple-bg-primary);
    border: 1px solid var(--apple-separator);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--apple-text-primary);
    appearance: none;
    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 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.apple-select:focus {
    outline: none;
    border-color: var(--apple-system-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Apple-style textarea */
.apple-textarea {
    background: var(--apple-bg-primary);
    border: 1px solid var(--apple-separator);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--apple-text-primary);
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s ease;
}

.apple-textarea:focus {
    outline: none;
    border-color: var(--apple-system-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.apple-textarea::placeholder {
    color: var(--apple-text-tertiary);
}

/* Apple-style table */
.apple-table {
    width: 100%;
    background: var(--apple-bg-primary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--apple-separator);
}

.apple-table th {
    background: var(--apple-bg-secondary);
    color: var(--apple-text-primary);
    font-weight: 600;
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--apple-separator);
}

.apple-table td {
    padding: 16px;
    color: var(--apple-text-primary);
    border-bottom: 1px solid var(--apple-separator);
}

.apple-table tr:last-child td {
    border-bottom: none;
}

.apple-table tr:hover {
    background: var(--apple-fill);
}

/* Apple-style modal */
.apple-modal {
    background: var(--apple-bg-primary);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--apple-separator);
}

.apple-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--apple-separator);
}

.apple-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--apple-text-primary);
    margin: 0;
}

.apple-modal-body {
    padding: 20px 24px;
}

.apple-modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--apple-separator);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Apple-style alerts */
.apple-alert {
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    border: 1px solid;
}

.apple-alert-success {
    background: rgba(52, 199, 89, 0.1);
    border-color: var(--apple-system-green);
    color: var(--apple-system-green);
}

.apple-alert-error {
    background: rgba(255, 59, 48, 0.1);
    border-color: var(--apple-system-red);
    color: var(--apple-system-red);
}

.apple-alert-warning {
    background: rgba(255, 149, 0, 0.1);
    border-color: var(--apple-system-orange);
    color: var(--apple-system-orange);
}

.apple-alert-info {
    background: rgba(0, 122, 255, 0.1);
    border-color: var(--apple-system-blue);
    color: var(--apple-system-blue);
}

/* Apple-style badges */
.apple-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apple-badge-primary {
    background: var(--apple-system-blue);
    color: white;
}

.apple-badge-success {
    background: var(--apple-system-green);
    color: white;
}

.apple-badge-error {
    background: var(--apple-system-red);
    color: white;
}

.apple-badge-warning {
    background: var(--apple-system-orange);
    color: white;
}

.apple-badge-secondary {
    background: var(--apple-bg-secondary);
    color: var(--apple-text-primary);
    border: 1px solid var(--apple-separator);
}

/* Apple-style loading spinner */
.apple-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--apple-fill);
    border-top: 2px solid var(--apple-system-blue);
    border-radius: 50%;
    animation: apple-spin 1s linear infinite;
}

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

/* Apple-style progress bar */
.apple-progress {
    width: 100%;
    height: 6px;
    background: var(--apple-fill);
    border-radius: 3px;
    overflow: hidden;
}

.apple-progress-bar {
    height: 100%;
    background: var(--apple-system-blue);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Apple-style switch */
.apple-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
}

.apple-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.apple-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--apple-fill);
    transition: 0.3s;
    border-radius: 15px;
}

.apple-switch-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.apple-switch input:checked + .apple-switch-slider {
    background-color: var(--apple-system-green);
}

.apple-switch input:checked + .apple-switch-slider:before {
    transform: translateX(20px);
}

/* Apple-style divider */
.apple-divider {
    height: 1px;
    background: var(--apple-separator);
    margin: 16px 0;
}

/* Apple-style list group */
.apple-list-group {
    background: var(--apple-bg-primary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--apple-separator);
}

.apple-list-item {
    padding: 16px;
    border-bottom: 1px solid var(--apple-separator);
    color: var(--apple-text-primary);
    transition: background-color 0.2s ease;
}

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

.apple-list-item:hover {
    background: var(--apple-fill);
}

.apple-list-item.active {
    background: rgba(0, 122, 255, 0.1);
    color: var(--apple-system-blue);
}
