:root {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #0071e3;
    --accent-hover: #0077ed;
    --button-text: #ffffff;
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.05);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.08);
    --radius-lg: 20px;
    --radius-md: 12px;
    --border-color: #d2d2d7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.header {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

.card {
    background: var(--card-bg);
    width: 100%;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.upload-area {
    width: 100%;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent-color);
    background: rgba(0, 113, 227, 0.05);
}

.upload-area p {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-area p span {
    color: var(--accent-color);
    font-weight: 500;
}

.upload-area .file-types {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.hidden {
    display: none !important;
}

.loader {
    font-weight: 500;
    color: var(--accent-color);
    animation: pulse 1.5s infinite;
}

.cropper-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.5s ease-out;
}

.image-container {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    background-color: #f0f0f0;
    border-radius: var(--radius-md);
}

img {
    max-width: 100%;
    display: block;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.ratio-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.ratio-btn {
    padding: 8px 16px;
    background: #f0f0f5;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
}

.ratio-btn:hover {
    background: #e0e0e5;
}

.ratio-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.custom-ratio {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.custom-ratio input[type="text"] {
    width: 140px;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.2s ease;
    background: #fafafa;
}

.custom-ratio input[type="text"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
    background: #fff;
}

.primary-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--accent-color);
    color: var(--button-text);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

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

.primary-btn:active {
    transform: scale(0.98);
}

.secondary-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 10px;
    transition: opacity 0.2s;
    text-align: center;
}

.secondary-btn:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.footer {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #a1a1a6;
    animation: fadeIn 1s ease-out 0.5s backwards;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .header h1 {
        font-size: 2rem;
    }
    .card {
        padding: 30px 20px;
    }
}
